If you look at the screenshots we take when a test times out, every one on 10.7 will show iCal running, and nearly every one will show the Bluetooth Setup Assistant running (conveniently, we time out a lot in the hidden permaorange suites, so you can look at lots of pictures). We know that we open iCal and leave it running, bug 449763, but that only accounts for it running during whichever hunk of mochitest runs that test, not for everywhere. Every time I've mentioned the Bluetooth Setup Assistant dialog, I've been told that nobody was in the dc at the time who could possibly have been attaching a keyboard. Well, wups, silly kitty that it is, Lion tries to be helpful by restoring running apps after a restart, even if getting rid of those running apps are a big part of the reason why we were restarting. Casual googling makes it sound like there's a checkbox in the "did you really want to restart?" dialog that may or may not actually work sometimes, and that you can close all apps and then get-info, lock, some plist in a location with a random string of numbers in it, but didn't find any satisfactory answer for automating not getting random apps restarted.
hmm, the article over at http://hints.macworld.com/article.php?story=20110918051930924 suggests that running the following command will turn off the feature. I don't know how effective this will be when using 'sudo reboot' instead of the graphical reboot tool. defaults write com.apple.loginwindow TALLogoutSavesState -bool false
I wonder if using Apple script to uncheck the checkbox on the restart screen would be the way to go. I know nothing of applescript, but I've cobbled together the following: tell application "System Events" tell process "Finder" tell menu bar 1 click menu "Apple" tell menu "Apple" click menu item "Restart…" end tell end tell end tell end tell which is enough to bring up the dialog box. This is where I become lost.
-- Reboot 10.7 without restoring windows -- Must enable assistive devices -- sudo touch /private/var/db/.AccessibilityAPIEnabled -- http://www.codemacs.com/coding/applescript/applescript-key-codes-reference.8288271.htm tell application "System Events" tell process "Finder" tell menu bar 1 click menu "Apple" tell menu "Apple" click menu item "Restart…" tell application "loginwindow" to activate key code 49 key code 52 end tell end tell end tell end tell This is enough to start the reboot, but not enough to force all applications to quit instead of asking the user whether or not they want to reboot.
Has anyone tried the steps by hand with a lion slave to see whether they work first?
I released a patch for this in bug 843545. This command seems to work /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow LoginwindowLaunchesRelaunchApps -bool false
(In reply to Kim Moir [:kmoir] from comment #6) > I released a patch for this in bug 843545. This command seems to work > > /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow > LoginwindowLaunchesRelaunchApps -bool false Does it need to be deployed anywhere else, or is this bug now a dupe?
I don't think it needs to be deployed anywhere else.