3

If I terminate the Xorg server with a SIGINT signal (eg. when I press Ctrl+C), what signal does it send to its clients?

1 Answer 1

4

The X server doesn't send a signal to its clients. This wouldn't be possible in general since the client and the server might not even be running on the same machine.

Communication between the server and the client goes through a socket. When the server dies, its end of the socket is closed. It's up to the client application to decide how to react to that; most print an error message and terminate.

If the client is a terminal emulator, then when it terminates, it sends SIGHUP to its controlling process, which is usually a shell. The shell in turn sends SIGHUP to the main process of each foreground or background job.

3
  • Thank you, I was curious about this because I had a running make job in an X terminal emulator. make can only do a cleanup of half-ready binaries if it can catch a signal eg. SIGHUP. So it is safe to terminate X if make is running in an X terminal if I got it right because make will receive SIGHUP. Commented Jun 20, 2014 at 6:56
  • 1
    @psimon Yes, make will receive SIGHUP. But you may want to run make inside screen or tmux instead, so that it keeps running and you can reconnect to the session even if X dies. Commented Jun 20, 2014 at 7:18
  • Yes, I regularly use screen, but in this specific case I forgot to use it (an automatic upgrade script handles the kernel upgrade on my security server, which is still experimental) and a mistyped command on a tty killed Xorg. I'm building this kernel image on an old P3 and it was running for two days, so I wanted to make sure that I can resume. Commented Jun 20, 2014 at 7:24

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.