Backport shibd script changes.
authorScott Cantor <cantor.2@osu.edu>
Tue, 14 Aug 2007 19:22:30 +0000 (19:22 +0000)
committerScott Cantor <cantor.2@osu.edu>
Tue, 14 Aug 2007 19:22:30 +0000 (19:22 +0000)
configs/Makefile.am
configs/shibd-debian.in [new file with mode: 0644]
configs/shibd-redhat.in [moved from configs/shibd.in with 96% similarity]
shibboleth.spec.in

index 89c8fc4..f17341a 100644 (file)
@@ -8,7 +8,8 @@ pkgxmldir = $(datadir)/xml/@PACKAGE@
 varrundir = $(localstatedir)/run
 pkgsysconfdir = $(sysconfdir)/@PACKAGE@
 pkgsysconf_DATA = \
-       shibd \
+       shibd-redhat \
+       shibd-debian \
        apache.config \
        apache2.config \
        apache22.config
@@ -61,7 +62,10 @@ apache2.config: ${srcdir}/apache2.config.in Makefile ${top_builddir}/config.stat
 apache22.config: ${srcdir}/apache22.config.in Makefile ${top_builddir}/config.status
        $(MAKE) do-build-file FILE=$@
 
-shibd: ${srcdir}/shibd.in Makefile ${top_builddir}/config.status
+shibd-redhat: ${srcdir}/shibd-redhat.in Makefile ${top_builddir}/config.status
+       $(MAKE) do-build-file FILE=$@
+
+shibd-debian: ${srcdir}/shibd-debian.in Makefile ${top_builddir}/config.status
        $(MAKE) do-build-file FILE=$@
 
 shibd.logger: ${srcdir}/shibd.logger.in Makefile ${top_builddir}/config.status
@@ -105,21 +109,23 @@ CLEANFILES = \
        apache.config \
        apache2.config \
        apache22.config \
-       shibd \
+       shibd-redhat \
+       shibd-debian \
        shibd.logger \
        native.logger \
        shibboleth.xml \
        AAP.xml \
        example-metadata.xml
 
-EXTRA_DIST = .cvsignore \
+EXTRA_DIST = \
        shibboleth.xml.in \
        native.logger.in \
        shibd.logger.in \
        apache.config.in \
        apache2.config.in \
        apache22.config.in \
-       shibd.in \
+       shibd-redhat.in \
+       shibd-debian.in \
        shibboleth.logger \
        accessError.html \
        rmError.html \
diff --git a/configs/shibd-debian.in b/configs/shibd-debian.in
new file mode 100644 (file)
index 0000000..59fd66d
--- /dev/null
@@ -0,0 +1,84 @@
+#! /bin/sh\r
+### BEGIN INIT INFO\r
+# Provides: shibd\r
+# Required-Start: $local_fs $remote_fs $network\r
+# Required-Stop: $local_fs $remote_fs $network\r
+# Default-Start: 2 3 4 5\r
+# Default-Stop: S 0 1 6\r
+# Short-Description: Shibboleth 1.3 Service Provider Daemon\r
+# Description: Starts the separate daemon used by the Shibboleth\r
+# Apache module to manage sessions and to retrieve\r
+# attributes from Shibboleth Identity Providers.\r
+### END INIT INFO\r
+#\r
+# Written by Quanah Gibson-Mount <quanah@stanford.edu>\r
+# Modified by Lukas Haemmerle <lukas.haemmerle@switch.ch> for Shibboleth 2\r
+# Based on the dh-make template written by:\r
+#\r
+# Written by Miquel van Smoorenburg <miquels@cistron.nl>.\r
+# Modified for Debian\r
+# by Ian Murdock <imurdock@gnu.ai.mit.edu>.\r
+\r
+PATH=/sbin:/bin:/usr/sbin:/usr/bin\r
+DESC="Shibboleth 1.3 daemon"\r
+NAME=shibd\r
+SHIB_HOME=@-PREFIX-@\r
+SHIB_CONFIG=@-PKGSYSCONFDIR-@/shibboleth.xml\r
+LD_LIBRARY_PATH=@-PREFIX-@/lib\r
+DAEMON=@-PREFIX-@/sbin/$NAME\r
+SCRIPTNAME=/etc/init.d/$NAME\r
+PIDFILE=/var/run/$NAME.pid\r
+DAEMON_OPTS=""\r
+\r
+# Force removal of socket\r
+DAEMON_OPTS="$DAEMON_OPTS -f"\r
+\r
+# Use defined configuration file\r
+DAEMON_OPTS="$DAEMON_OPTS -c $SHIB_CONFIG"\r
+\r
+# Specify pid file to use\r
+DAEMON_OPTS="$DAEMON_OPTS -p $PIDFILE"\r
+\r
+# Exit if the package is not installed.\r
+[ -x "$DAEMON" ] || exit 0\r
+\r
+# Read configuration if it is present.\r
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME\r
+\r
+# Get the setting of VERBOSE and other rcS variables.\r
+[ -f /etc/default/rcS ] && . /etc/default/rcS\r
+\r
+case "$1" in\r
+start)\r
+    # Don't start shibd if NO_START is set.\r
+    if [ "$NO_START" = 1 ] ; then\r
+        echo "Not starting $DESC (see /etc/default/$NAME)"\r
+        exit 0\r
+    fi\r
+    echo -n "Starting $DESC: "\r
+    start-stop-daemon --background --start --quiet \\r
+        --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS\r
+    echo "$NAME."\r
+    ;;\r
+stop)\r
+    echo -n "Stopping $DESC: "\r
+    start-stop-daemon --stop --quiet --pidfile $PIDFILE \\r
+        --exec $DAEMON\r
+    echo "$NAME."\r
+    ;;\r
+restart|force-reload)\r
+    echo -n "Restarting $DESC: "\r
+    start-stop-daemon --stop --quiet --pidfile $PIDFILE \\r
+        --exec $DAEMON\r
+    sleep 1\r
+    start-stop-daemon --background --start --quiet \\r
+        --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS\r
+    echo "$NAME."\r
+    ;;\r
+*)\r
+    echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2\r
+    exit 1\r
+    ;;\r
+esac\r
+\r
+exit 0\r
similarity index 96%
rename from configs/shibd.in
rename to configs/shibd-redhat.in
index 059e3d5..8c2447e 100644 (file)
@@ -3,7 +3,7 @@
 # Startup script for the Shibboleth Service Provider Daemon
 #
 # chkconfig: - 98 02
-# description: Shibboleth Service Provider Daemon
+# description: Shibboleth 1.3 Service Provider Daemon
 # processname: shibd
 # pidfile: @-VARRUNDIR-@/shibd.pid
 # config: @-PKGSYSCONFDIR-@/shibboleth.xml
index 77a90c7..39e4f08 100644 (file)
@@ -141,7 +141,7 @@ fi
 %if "%{_vendor}" == "redhat"
        if [ -d %{_sysconfdir}/init.d ] ; then
                if [ ! -f %{_sysconfdir}/init.d/shibd ] ; then
-                       cp -p %{_sysconfdir}/shibboleth/shibd %{_sysconfdir}/init.d/shibd
+                       cp -p %{_sysconfdir}/shibboleth/%{_vendor} %{_sysconfdir}/init.d/shibd
                        chmod 755 %{_sysconfdir}/init.d/shibd
                        chkconfig --add shibd
                fi
@@ -195,7 +195,8 @@ restorecon %{_sbindir}/shibd
 %config %{_sysconfdir}/shibboleth/sp-example.key
 %{_sysconfdir}/shibboleth/*.dist
 %{_sysconfdir}/shibboleth/apache*.config
-%{_sysconfdir}/shibboleth/shibd
+%{_sysconfdir}/%{name}/shibd-redhat
+%{_sysconfdir}/%{name}/shibd-debian
 
 %exclude %{_bindir}/posttest
 %exclude %{_bindir}/test-client