[PATCH rhel7-branch] Fix hang at reboot with VNC installs (#1036572)

Will Woods wwoods at redhat.com
Mon Sep 8 23:22:34 UTC 2014

Calling vnc.shutdownServer() causes the window manager to terminate
(naturally), which makes startMetacityWM() call os._exit(0).

Obviously, if that happens before we've initiated reboot, the system
won't reboot. So don't do that until after initiating reboot.

(In fact, we probably don't *need* to shut down VNC when we're doing
reboot/halt/etc, since that process will kill the server for us.. but
for other use-cases we should still clean up after ourselves.)
 anaconda | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/anaconda b/anaconda
index ae88954..f00415d 100755
--- a/anaconda
+++ b/anaconda
@@ -54,9 +54,6 @@ def exitHandler(rebootData, storage, exitCode=None):
         if os.path.isdir('/mnt/sysimage/root'):
-    if flags.usevnc:
-        vnc.shutdownServer()
     if exitCode:
@@ -94,6 +91,11 @@ def exitHandler(rebootData, storage, exitCode=None):
         else: # reboot action is KS_REBOOT or None
             subprocess.Popen(["systemctl", "--no-wall", "reboot"])
+    # Shutting down the server makes the window manager terminate, which makes
+    # us do os._exit(0) (see below). So this needs to happen at the very end.
+    if flags.usevnc:
+        vnc.shutdownServer()
 def startMetacityWM():
     childpid = os.fork()
     if not childpid:

More information about the anaconda-patches mailing list