Reduce the likihood of a lingering /var/run/com.googlecode.munki.ManagedSoftwareUpdate by sleeping for 1/2 a second (instead of .1) and using open() instead of subprocess+touch to write the file.

This commit is contained in:
Justin McWilliams
2011-11-08 12:42:41 -05:00
parent 8bd3bd327f
commit 06801d2ef7
2 changed files with 4 additions and 4 deletions

View File

@@ -354,9 +354,9 @@ def notifyUserOfUpdates(force=False):
# notify user of available updates using LaunchAgent to start
# Managed Software Update.app in the user context.
launchfile = '/var/run/com.googlecode.munki.ManagedSoftwareUpdate'
cmd = ['/usr/bin/touch', launchfile]
unused_retcode = subprocess.call(cmd)
time.sleep(1)
f = open(launchfile, 'w')
f.close()
time.sleep(0.5)
if os.path.exists(launchfile):
os.unlink(launchfile)
user_was_notified = True