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

Brian C. Lane bcl at redhat.com
Wed Sep 10 00:49:44 UTC 2014


On Tue, Sep 09, 2014 at 10:43:43AM -0400, Will Woods wrote:
> If the X server goes away, anaconda (like other X clients) will get an X
> IO error; by default this is handled (in libX11) by doing an exit(1).
> (It's also possible that the dbus server dies before us, and then we get
> a dbus error; the default handler for that (in libdbus) is... exit(1).)
> Either way: calling vnc.shutdownServer() can make anaconda exit early.
> 
> 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 the shutdown process will kill the server for
> us.. but for other use-cases we should still clean up after ourselves.)
> ---
>  anaconda | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/anaconda b/anaconda
> index ae88954..419466b 100755
> --- a/anaconda
> +++ b/anaconda
> @@ -54,9 +54,6 @@ def exitHandler(rebootData, storage, exitCode=None):
>          if os.path.isdir('/mnt/sysimage/root'):
>              cov.save()
>  
> -    if flags.usevnc:
> -        vnc.shutdownServer()
> -
>      if exitCode:
>          anaconda.intf.shutdown()
>  
> @@ -94,6 +91,12 @@ def exitHandler(rebootData, storage, exitCode=None):
>          else: # reboot action is KS_REBOOT or None
>              subprocess.Popen(["systemctl", "--no-wall", "reboot"])
>  
> +    # Shutting down the server may make anaconda terminate early, via the
> +    # default X11 io error handler or the libdbus error handler.
> +    # So save this for last, after we've initiated poweroff/halt/reboot.
> +    if flags.usevnc:
> +        vnc.shutdownServer()
> +
>  def startMetacityWM():
>      childpid = os.fork()
>      if not childpid:
> -- 
> 1.9.3

Ack

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list