Controlling GDM

You can control GDM behavior during runtime in several different ways. You can either run certain commands, or you can talk to GDM using either a unix socket protocol, or a FIFO protocol.

Commands

To stop GDM, you can either send the TERM signal to the main daemon or run the gdm-stop command which is in the sbin/ directory. To restart GDM, you can either send the HUP signal to the main daemon or run the gdm-restart command which is also in the sbin/ directory. To restart GDM but only after all the users have logged out, you can either send the USR1 signal to the main daemon or run the gdm-safe-restart command which is in the sbin/ directory as well.

The gdmflexiserver command can be used to start new flexible (on demand) servers. Run gdmflexiserver --help to get a listing of possible options. This command will also lock the current screen with xscreensaver so that the user can safely walk away from the machine and let someone else log in. XFree86 will automatically switch back to the same virtual terminal (if your operating system supports it), after the new session has ended, so this should work quite transparently to the users.

Socket Protocol

GDM provides a unix domain socket for communication at /tmp/.gdm_socket. Using this you can check if GDM is running, the version of the daemon, the current servers that are running and who is logged in on them, and if GDM supports it on your operating system, also the virtual terminals of all the console logins. You can also request new flexible servers to be run with this protocol, but this is best done with the gdmflexiserver command.

Full and up to date documentation of the commands and their use is contained in the GDM source tree in the file daemon/gdm.h. Look for the defines starting with GDM_SUP_.

The FIFO protocol

GDM also provides a FIFO called .gdmfifo in the ServAuthDir directory (usually var/gdm/.gdmfifo). You must be root to use this protocol, and it is mostly used for internal GDM chatter. It is a very simple protocol where you just echo a command on a single line to this file. It can be used to tell GDM things such as restart, suspend the machine, or restart all X servers next time it has a chance (which would be useful from an X configuration program).

Full and up to date documentation of the commands and their use is contained in the GDM source tree in the file daemon/gdm.h. Look for the defines starting with GDM_SOP_. The commands which require the pid of the slave as an argument are the ones that are really used for internal communication of the slave with the master and should not be used.