mirror of
https://github.com/munki/munki.git
synced 2026-01-05 22:20:00 -06:00
Stub code for the case where Fast User Switching is active, we're switched to the loginwindow with one or more users logged in, and we need to restart.
git-svn-id: http://munki.googlecode.com/svn/trunk@443 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
@@ -143,10 +143,22 @@ def doRestart():
|
||||
else:
|
||||
print restartMessage
|
||||
sys.stdout.flush()
|
||||
|
||||
if munkicommon.getconsoleuser() == None:
|
||||
|
||||
consoleuser = munkicommon.getconsoleuser()
|
||||
if consoleuser == None:
|
||||
# no-one is logged in and we're at the loginwindow
|
||||
time.sleep(5)
|
||||
retcode = subprocess.call(["/sbin/shutdown", "-r", "now"])
|
||||
elif consoleuser == u"loginwindow":
|
||||
# crap. Someone is logged in, Fast User Switching is active,
|
||||
# but we're switched out to the loginwindow. Not safe to
|
||||
# restart because users might have unsaved work.
|
||||
# this could happen if someone switched to the loginwindow while
|
||||
# updates were being installed.
|
||||
#
|
||||
# TO-DO: handle this!
|
||||
#
|
||||
pass
|
||||
else:
|
||||
if munkicommon.munkistatusoutput:
|
||||
# someone is logged in and we're using munkistatus
|
||||
|
||||
Reference in New Issue
Block a user