What happens when the X server dies? - Xwindows

This is a discussion on What happens when the X server dies? - Xwindows ; I'm very much a novice at X, but I need to find out what is happening when the X server dies. In this case the X server is Hummingbird Exceed on a PC, with olwm window manager and applications running ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: What happens when the X server dies?

  1. What happens when the X server dies?

    I'm very much a novice at X, but I need to find out what is happening when
    the X server dies.

    In this case the X server is Hummingbird Exceed on a PC, with olwm window
    manager and applications running on a UNIX workstation. If the Exceed window
    is closed on the PC, olwm and all of the gui applications on the workstation
    quickly terminate - but what is the mechanism?

    Does the olwm on the workstation detect a socket closure to the terminated X
    server and then send SIGHUP to all of the applications which are using the
    window manager?

    Also, is there a way to initiate a similar closure of all apps and the olwm
    from the workstation? Perhaps by sending a signal to the olwm process?



  2. Re: What happens when the X server dies?

    "Richard" writes:

    > I'm very much a novice at X, but I need to find out what is happening when
    > the X server dies.
    >
    > In this case the X server is Hummingbird Exceed on a PC, with olwm window
    > manager and applications running on a UNIX workstation. If the Exceed window
    > is closed on the PC, olwm and all of the gui applications on the workstation
    > quickly terminate - but what is the mechanism?


    Xlib will notice that the socket is closed and generate an error. If
    this error isn't explicitly handled by the application it will
    terminate, printing a message on the terminal. Applications that set
    a custom error handler will typically also exit when the connection is
    lost.

    > Does the olwm on the workstation detect a socket closure to the terminated X
    > server and then send SIGHUP to all of the applications which are using the
    > window manager?


    I don't think that is the case. The window manager exists
    independently from the windows it manages. It is possible to kill one
    window manager and start a different one.

    --
    Måns Rullgård
    mru@kth.se

  3. Re: What happens when the X server dies?

    "Måns Rullgård" wrote in message
    news:yw1xr7tom3o6.fsf@kth.se...
    > Xlib will notice that the socket is closed and generate an error. If
    > this error isn't explicitly handled by the application it will
    > terminate, printing a message on the terminal. Applications that set
    > a custom error handler will typically also exit when the connection is
    > lost.


    Thanks. So is there a socket connection between each application and the X
    server? And the Xlib part of the application detects the socket closure when
    the X server dies?

    Is there a way to simulate the death of the X server from the workstation
    end, say via a shell script? The death of the X server seems to conveniently
    lead to the termination of all gui applications, and it would be useful if
    it was possible to cause this to happen from a process running on the
    workstation (hence my query if signalling the olwm would cause this to
    happen). If the only way to do this is to individually signal each
    application then you would have to know which applications were running
    beforehand.



  4. Re: What happens when the X server dies?

    Richard wrote:
    >I'm very much a novice at X, but I need to find out what is happening when
    >the X server dies.
    >
    >In this case the X server is Hummingbird Exceed on a PC, with olwm window
    >manager and applications running on a UNIX workstation. If the Exceed window
    >is closed on the PC, olwm and all of the gui applications on the workstation
    >quickly terminate - but what is the mechanism?
    >
    >Does the olwm on the workstation detect a socket closure to the terminated X
    >server and then send SIGHUP to all of the applications which are using the
    >window manager?
    >
    >Also, is there a way to initiate a similar closure of all apps and the olwm
    >from the workstation? Perhaps by sending a signal to the olwm process?


    Each app has its own connection to the server; when the connection is
    closed, Xlib treats this as a fatal I/O error (XSetIOErrorHandler), which
    by default terminates the application. The window manager is a normal
    app in this regard.

    There is nothing in particular that connects client apps, other than the
    fact that they are using the same X server. This could be used to write
    a script that uses the output of netstat to kill off clients.


  5. Re: What happens when the X server dies?

    Richard wrote:
    >
    > Is there a way to simulate the death of the X server from the workstation
    > end, say via a shell script?


    You might want to look at the source of the xkill client and the
    XKillClient function of Xlib. You are describing something like "xkill
    -all" more or less.


    Also you might want to look into putting a second "groupware" X server
    between the client and the current X server. You can do this with VNC
    or XMX and probably others. These servers are designed to really do
    the opposite of what you want. They are designed to let you retain an
    X session when the physical display is not available or to move a
    session from one physical display to another. The clients connect to a
    "proxy" X server not associated with hardware. Then you direct the
    "proxy" X server to a "real" X server. The clients persist as long as
    the proxy remains running. If you kill the "proxy" the clients see it
    but the real X server just sees a client go away.

    -- ced


    > The death of the X server seems to conveniently
    > lead to the termination of all gui applications, and it would be useful if
    > it was possible to cause this to happen from a process running on the
    > workstation (hence my query if signalling the olwm would cause this to
    > happen). If the only way to do this is to individually signal each
    > application then you would have to know which applications were running
    > beforehand.



    --
    Chuck Dillon
    Senior Software Engineer
    NimbleGen Systems Inc.

+ Reply to Thread