Disabling Bluetooth Assistant and app relaunch in 10.7 via Puppet
>> Monday, February 25, 2013
Intermittent test failures are very annoying. The create noise that cause people to question the test results - is it real data or just noise?
Image ©misspixels, http://www.flickr.com/photos/misspixels/8480711076/in/photostream/ under Creative Commons by-nc-sa 2.0 |
1) Despite Bluetooth being disabled, the Bluetooth setup assistant would randomly start and take focus away from running tests.
2) Our talos boxes reboot and repuppetize after a test job has completed. However, on 10.7, the default is to relaunch apps that were running before reboot. Thus, if an app crashed, it would be restarted upon reboot and again interfere with tests.
If this was just a machine on your desktop, you could disable the preferences in the the UI. However, since we manage our infrastructure via Puppet, I needed a command line way to implement this preference change and update our 80+ Lion test machines automatically.
To disable setup assistant for Bluetooth mouse and keyboard
defaults write /Library/Preferences/com.apple.Bluetooth BluetoothAutoSeekPointingDevice -bool false
defaults write /Library/Preferences/com.apple.Bluetooth BluetoothAutoSeekKeyboard -bool false
To disable apps from restarting upon reboot
defaults write /Library/Preferences/com.apple.loginwindow LoginwindowLaunchesRelaunchApps -bool false
Note: the disabling the apps from restarting doesn't uncheck the preference in the UI, but it does work.
Having spent many years as a Linux sysadmin, I find the way that Apple manages preferences within their operating systems non-intuitive and generally poorly documented. In any case, it took me quite a bit of digging to find the correct defaults incantation, so I thought I'd blog about it in case others had the same problem :-)
References
Bug 843545 Intermittent OSX 10.7 mochitest failures that seem related to Bluetooth Setup Assistant crashing
Bug 743594 Stop 10.7 from restoring apps after a restart Read more...