Added ipconfig waitall for startup runs.

checkandinstallatstartup now does not clear its flag until there's nothing to do; it will run, install and restart until there is nothing to do.

git-svn-id: http://munki.googlecode.com/svn/trunk@538 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
Greg Neagle
2010-05-25 22:20:45 +00:00
parent 5350042f4d
commit cdc0ef777f
2 changed files with 18 additions and 2 deletions
+17 -1
View File
@@ -301,11 +301,20 @@ def main():
"/Users/Shared/.com.googlecode.munki.checkandinstallatstartup"]
for f in triggerfiles:
if os.path.exists(f):
os.unlink(f)
user_triggered = True
if f.endswith("startup"):
# HACK: sometimes this runs before the network is up.
# we'll attempt to wait until network interfaces are up
# before continuing
cmd = ["/usr/sbin/ipconfig", "waitall"]
retcode = subprocess.call(cmd)
if f.endswith("checkandinstallatstartup"):
runtype = "checkandinstallatstartup"
options.installonly = False
options.auto = True
else:
# delete triggerfile if _not_ checkandinstallatstartup
os.unlink(f)
if not user_triggered:
exit(0)
@@ -485,6 +494,13 @@ def main():
# no updates available
if options.installonly and not options.quiet:
print "Nothing to install or remove."
if runtype == "checkandinstallatstartup":
# we have nothing to do, so remove the trigger file
# so we'll stop running at restart
triggerfile = \
"/Users/Shared/.com.googlecode.munki.checkandinstallatstartup"
if os.path.exists(triggerfile):
os.unlink(triggerfile)
# finish our report
munkicommon.report['EndTime'] = time.ctime()
+1 -1
View File
@@ -41,7 +41,7 @@ import FoundationPlist
def get_version():
'''Returns version of munkitools'''
return "0.5.1"
return "0.5.2"
# output and logging functions