I think I finally found the reason for the problem. Everytime the orientation is changed the new orientation is saved in monitors.xml while the original monitors.xml is saved as monitors.xml.backup. By playing around with chattr I found out that this causes Ubuntu to try to restore monitors.xml out of monitors.xml.backup after every login.
So if I turn the screen to the left and then back to normal, monitors.xml says "orientation=normal" and monitors.xml.backup says "orientation=left". After the login Ubuntu overwrites monitors.xml with the backup and uses its configuration and turns the screen to the left. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1316901 Title: Wrong screen rotation at login To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/meta-gnome3/+bug/1316901/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs