summaryrefslogtreecommitdiff
path: root/gdm-safe-restart.in
diff options
context:
space:
mode:
authorGeorge Lebl <jirka@5z.com>2001-07-05 03:57:43 +0000
committerGeorge Lebl <jirka@src.gnome.org>2001-07-05 03:57:43 +0000
commita277ba17bf69aa34f7f077b4ed3d0f30852db0f3 (patch)
treea755af0af512deeca37ffb50cb7dc92b106b528e /gdm-safe-restart.in
parent0fb36737a60a830d040a4f1d62df1fab6395109d (diff)
downloadgdm-a277ba17bf69aa34f7f077b4ed3d0f30852db0f3.tar.gz
The fifo is not only for chooser now, it is a general protocol to control
Wed Jul 04 20:58:31 2001 George Lebl <jirka@5z.com> * gdm-safe-restart.in, Makefile.am, configure.in, daemon/choose.[ch], daemon/gdm.[ch], daemon/slave.c, daemon/xdmcp.c, gui/gdmconfig.c: The fifo is not only for chooser now, it is a general protocol to control some gdm things, more to come. It's writing direct binary structs, but then again this is only a fifo and you should only be able to write to it from gdm and root account on the same machine. The daemon now knows when a user is logged in on a display and there is a safe restart option with SIGUSR1 to the daemon. Also the daemon knows the x pids now and can whack the X server when the slave crashes, so that we don't get busy hanging server. * daemon/misc.c: fails are LOG_CRIT not LOG_ERR (I hope this is correct)
Diffstat (limited to 'gdm-safe-restart.in')
-rwxr-xr-xgdm-safe-restart.in13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdm-safe-restart.in b/gdm-safe-restart.in
new file mode 100755
index 00000000..26204777
--- /dev/null
+++ b/gdm-safe-restart.in
@@ -0,0 +1,13 @@
+#!/bin/sh
+PIDFILE=`grep '^PidFile=' @sysconfdir@/gdm/gdm.conf | sed -e 's/^PidFile=//'`
+if test x$PIDFILE = x ; then
+ echo "Can't find the PID file in the configuration file, going to try:"
+ echo "/var/run/gdm.pid"
+ PIDFILE=/var/run/gdm.pid
+fi
+if test '!' -f $PIDFILE ; then
+ echo "$PIDFILE doesn't exist, perhaps GDM isn't running"
+ exit 1
+fi
+# exec the kill to get the correct return code
+exec kill -USR1 `cat $PIDFILE`