mirror of
https://github.com/munki/munki.git
synced 2026-02-05 06:41:07 -06:00
Speed launch of MSU.app status mode to cover the login window following logout install actions.
This commit is contained in:
@@ -64,6 +64,9 @@ class MSUAppDelegate(NSObject):
|
||||
self.runmode = runmode
|
||||
NSLog("Runmode: %s" % runmode)
|
||||
|
||||
# Clear our fast-launch trigger file if present.
|
||||
munki.clearLaunchTrigger()
|
||||
|
||||
# Prevent automatic relaunching at login on Lion
|
||||
if NSApp.respondsToSelector_('disableRelaunchOnLogin'):
|
||||
NSApp.disableRelaunchOnLogin()
|
||||
|
||||
@@ -35,6 +35,7 @@ from Foundation import CFPreferencesAppSynchronize
|
||||
|
||||
|
||||
INSTALLATLOGOUTFILE = "/private/tmp/com.googlecode.munki.installatlogout"
|
||||
STATUSATLOGOUTFILE = "/private/tmp/com.googlecode.munki.statusatlogout"
|
||||
UPDATECHECKLAUNCHFILE = \
|
||||
"/private/tmp/.com.googlecode.munki.updatecheck.launchd"
|
||||
MSULOGDIR = \
|
||||
@@ -350,11 +351,25 @@ def logoutAndUpdate():
|
||||
if not os.path.exists(INSTALLATLOGOUTFILE):
|
||||
f = open(INSTALLATLOGOUTFILE, 'w')
|
||||
f.close()
|
||||
if not os.path.exists(STATUSATLOGOUTFILE):
|
||||
f = open(STATUSATLOGOUTFILE, 'w')
|
||||
f.close()
|
||||
logoutNow()
|
||||
except (OSError, IOError):
|
||||
return 1
|
||||
|
||||
|
||||
def clearLaunchTrigger():
|
||||
'''Clear the trigger file that fast-launches us at loginwindow.
|
||||
typically because we have been launched in statusmode at the
|
||||
loginwindow to perform a logout-install.'''
|
||||
try:
|
||||
if os.path.exists(STATUSATLOGOUTFILE):
|
||||
os.unlink(STATUSATLOGOUTFILE)
|
||||
except (OSError, IOError):
|
||||
return 1
|
||||
|
||||
|
||||
def justUpdate():
|
||||
'''Trigger managedinstaller via launchd KeepAlive path trigger
|
||||
We touch a file that launchd is is watching
|
||||
|
||||
@@ -102,6 +102,9 @@ def alertUserOfForcedLogout(info=None):
|
||||
# make sure flag is in place to cause munki to install at logout
|
||||
f = open('/private/tmp/com.googlecode.munki.installatlogout', 'w')
|
||||
f.close()
|
||||
# drop flag for speedier launch of status window covering loginwindow
|
||||
f = open('/private/tmp/com.googlecode.munki.statusatlogout', 'w')
|
||||
f.close()
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
<string>com.googlecode.munki.MunkiStatus</string>
|
||||
<key>LimitLoadToSessionType</key>
|
||||
<array>
|
||||
<string>LoginWindow</string>
|
||||
<string>Aqua</string>
|
||||
</array>
|
||||
<key>EnvironmentVariables</key>
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>com.googlecode.munki.MunkiStatusLogin</string>
|
||||
<key>LimitLoadToSessionType</key>
|
||||
<array>
|
||||
<string>LoginWindow</string>
|
||||
</array>
|
||||
<key>EnvironmentVariables</key>
|
||||
<dict>
|
||||
<key>ManagedSoftwareUpdateMode</key>
|
||||
<string>MunkiStatus</string>
|
||||
</dict>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/Applications/Utilities/Managed Software Update.app/Contents/MacOS/Managed Software Update</string>
|
||||
</array>
|
||||
<key>RunAtLoad</key>
|
||||
<false/>
|
||||
<key>KeepAlive</key>
|
||||
<dict>
|
||||
<key>PathState</key>
|
||||
<dict>
|
||||
<key>/var/run/com.googlecode.munki.MunkiStatus</key>
|
||||
<true/>
|
||||
<key>/private/tmp/com.googlecode.munki.statusatlogout</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -3,6 +3,6 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.8.0</string>
|
||||
<string>0.8.0.1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
Reference in New Issue
Block a user