From 216a8e5b324f52a3e4d13eccb0cf956f275aefab Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 20 Apr 2007 08:39:35 +0000 Subject: Fixes the pid file handling in the gdm-restart/stop/safe-restart scripts. 2007-04-20 William Jon McCann * Makefile.am: * configure.ac: * gdm-restart.in: * gdm-safe-restart.in: * gdm-stop.in: * gdm.spec.in: * gdmsetup-pam: * gdmsetup-security.in: * utils/Makefile.am: * utils/gdm-restart.in: * utils/gdm-safe-restart.in: * utils/gdm-stop.in: Fixes the pid file handling in the gdm-restart/stop/safe-restart scripts. Moves the scripts to the utils subdir. Moves the gdmsetup stuff from toplevel to utils subdir. Removes gdm.spec. Fixes #431462 svn path=/trunk/; revision=4845 --- utils/Makefile.am | 55 +++++++++++++++++++++++++++++++++++++++++++--- utils/gdm-restart.in | 9 ++++++++ utils/gdm-safe-restart.in | 9 ++++++++ utils/gdm-stop.in | 9 ++++++++ utils/gdmsetup-pam | 6 +++++ utils/gdmsetup-security.in | 5 +++++ 6 files changed, 90 insertions(+), 3 deletions(-) create mode 100755 utils/gdm-restart.in create mode 100755 utils/gdm-safe-restart.in create mode 100755 utils/gdm-stop.in create mode 100644 utils/gdmsetup-pam create mode 100644 utils/gdmsetup-security.in (limited to 'utils') diff --git a/utils/Makefile.am b/utils/Makefile.am index 759c70b7..e4f02792 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -1,4 +1,5 @@ -## Process this file with automake to produce makefile.in +NULL = + DEFS = @DEFS@ -DGDM_CONFIG_FILE=\"$(gdmconfdir)/gdm.conf\" \ -DGDM_FACTORY_CONFIG_FILE=\"$(gdmconfdir)/factory-gdm.conf\" \ -DGDM_GLADE_DIR=\"@datadir@/gdm\" @@ -11,7 +12,36 @@ INCLUDES = \ -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ $(UTILS_CFLAGS) -EXTRA_DIST = gdm-ssh-session +edit = sed \ + -e 's|@sbindir[@]|$(sbindir)|g' \ + -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ + -e 's|@localstatedir[@]|$(localstatedir)|g' \ + -e 's|@GDM_PID_FILE[@]|$(GDM_PID_FILE)|g' + +gdm-stop: gdm-stop.in Makefile + $(edit) $< >$@ +gdm-restart: gdm-restart.in Makefile + $(edit) $< >$@ +gdm-safe-restart: gdm-safe-restart.in Makefile + $(edit) $< >$@ +gdmsetup: gdmsetup-security.in + $(edit) gdmsetup + + +sbin_SCRIPTS = \ + gdm-stop \ + gdm-restart \ + gdm-safe-restart \ + $(NULL) + +EXTRA_DIST = \ + gdm-ssh-session \ + gdm-stop.in \ + gdm-restart.in \ + gdm-safe-restart.in \ + gdmsetup-pam \ + gdmsetup-security.in \ + $(NULL) libexec_SCRIPTS = \ @GDMSSHSESSION@ @@ -20,7 +50,7 @@ libexec_PROGRAMS = \ @GDMASKPASS@ \ @GDMOPEN@ \ @GDMPREFETCH@ \ - gdmtranslate + gdmtranslate if DMX_SUPPORT bin_PROGRAMS = gdm-dmx-reconnect-proxy @@ -63,3 +93,22 @@ gdm_dmx_reconnect_proxy_LDADD = \ -lX11 \ $(DMX_LIBS) endif + +if CONSOLE_HELPER +cappsdir = $(PAM_PREFIX)/security/console.apps +capps_DATA = gdmsetup + +install-data-local: + $(mkinstalldirs) $(DESTDIR)$(PAM_PREFIX)/pam.d + $(INSTALL_DATA) $(srcdir)/gdmsetup-pam $(DESTDIR)$(PAM_PREFIX)/pam.d/gdmsetup +else +install-data-local: +endif + +CLEANFILES = \ + gdmsetup-security \ + $(NULL) + +DISTCLEANFILES = \ + gdmsetup \ + $(NULL) diff --git a/utils/gdm-restart.in b/utils/gdm-restart.in new file mode 100755 index 00000000..db1d634b --- /dev/null +++ b/utils/gdm-restart.in @@ -0,0 +1,9 @@ +#!/bin/sh + +PIDFILE=@GDM_PID_FILE@ +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 -HUP `cat $PIDFILE` diff --git a/utils/gdm-safe-restart.in b/utils/gdm-safe-restart.in new file mode 100755 index 00000000..8b75a97f --- /dev/null +++ b/utils/gdm-safe-restart.in @@ -0,0 +1,9 @@ +#!/bin/sh + +PIDFILE=@GDM_PID_FILE@ +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` diff --git a/utils/gdm-stop.in b/utils/gdm-stop.in new file mode 100755 index 00000000..546c6b51 --- /dev/null +++ b/utils/gdm-stop.in @@ -0,0 +1,9 @@ +#!/bin/sh + +PIDFILE=@GDM_PID_FILE@ +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 -TERM `cat $PIDFILE` diff --git a/utils/gdmsetup-pam b/utils/gdmsetup-pam new file mode 100644 index 00000000..ecb84946 --- /dev/null +++ b/utils/gdmsetup-pam @@ -0,0 +1,6 @@ +#%PAM-1.0 +auth sufficient pam_rootok.so +auth required pam_stack.so service=system-auth +session required pam_permit.so +session optional pam_xauth.so +account required pam_permit.so diff --git a/utils/gdmsetup-security.in b/utils/gdmsetup-security.in new file mode 100644 index 00000000..4db426ac --- /dev/null +++ b/utils/gdmsetup-security.in @@ -0,0 +1,5 @@ +USER=root +PROGRAM=@sbindir@/gdmsetup +SESSION=true +FALLBACK=false + -- cgit v1.2.1