--- /dev/null
+#! /bin/sh
+# Author: Peter Schober <peter.schober@univie.ac.at> and many others
+# based on shibd-debian (from Shibboleth's 1.3.1 SP source distribution)
+# and SUSE's /etc/init.d/cyrus
+#
+# /etc/init.d/shibd
+#
+### BEGIN INIT INFO
+# Provides: shibd
+# Required-Start: network
+# Required-Stop:
+# Default-Start: 3 5
+# Default-Stop:
+# Short-Description: Shibboleth 2.x Service Provider Daemon
+# Description: Starts the separate daemon used by the Shibboleth
+# Apache module to manage state and SAML interactions.
+### END INIT INFO
+#
+
+DESC="Shibboleth 2 daemon"
+NAME=shibd
+SHIB_CONFIG=@-PKGSYSCONFDIR-@/shibboleth2.xml
+DAEMON=@-PREFIX-@/sbin/$NAME
+SCRIPTNAME=/etc/init.d/$NAME
+PID_FILE=@-PKGRUNDIR-@/shibd.pid
+DAEMON_OPTS=""
+
+# Force removal of socket
+DAEMON_OPTS="$DAEMON_OPTS -f"
+
+# Use defined configuration file
+DAEMON_OPTS="$DAEMON_OPTS -c $SHIB_CONFIG"
+
+# Specify pid file to use
+DAEMON_OPTS="$DAEMON_OPTS -p $PID_FILE"
+
+# Exit if the package is not installed.
+test -x "$DAEMON" || exit 5
+
+. /etc/rc.status
+
+# First reset status of this service
+rc_reset
+
+case "$1" in
+ start)
+ echo -n "Starting $DESC ($NAME)"
+ ## Start daemon with startproc(8). If this fails
+ ## the echo return value is set appropriate.
+
+ # NOTE: startproc return 0, even if service is
+ # already running to match LSB spec.
+ /sbin/startproc -p $PID_FILE $DAEMON $DAEMON_OPTS > /dev/null 2>&1
+
+ # Remember status and be verbose
+ rc_status -v
+ ;;
+ stop)
+ echo -n "Shutting down $DESC ($NAME)"
+ ## Stop daemon with killproc(8) and if this fails
+ ## set echo the echo return value.
+
+ /sbin/killproc -p $PID_FILE -TERM $DAEMON > /dev/null 2>&1
+
+ # Remember status and be verbose
+ rc_status -v
+ ;;
+ try-restart)
+ ## Stop the service and if this succeeds (i.e. the
+ ## service was running before), start it again.
+ ## Note: try-restart is not (yet) part of LSB (as of 0.7.5)
+ $0 status >/dev/null && $0 restart
+
+ # Remember status and be quiet
+ rc_status
+ ;;
+ restart)
+ ## Stop the service and regardless of whether it was
+ ## running or not, start it again.
+ $0 stop
+ $0 start
+
+ # Remember status and be quiet
+ rc_status
+ ;;
+ configtest)
+ ## Check config files
+
+ echo -n "Checking config for $DESC ($NAME): "
+ $DAEMON $DAEMON_OPTS -t
+ rc_status -v
+ ;;
+ status)
+ echo -n "Checking for service $DESC ($NAME)"
+ ## Check status with checkproc(8), if process is running
+ ## checkproc will return with exit status 0.
+
+ # Status has a slightly different for the status command:
+ # 0 - service running
+ # 1 - service dead, but /var/run/ pid file exists
+ # 2 - service dead, but /var/lock/ lock file exists
+ # 3 - service not running
+
+ # NOTE: checkproc returns LSB compliant status values.
+ /sbin/checkproc -p $PID_FILE $DAEMON
+ rc_status -v
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|configtest|try-restart|restart}"
+ exit 1
+ ;;
+esac
+rc_exit
fi
fi
-%if "%{_vendor}" == "redhat"
+%if "%{_vendor}" == "redhat" || "%{_vendor}" == "suse"
# %{_initddir} not yet in RHEL5, use deprecated %{_initrddir}
mkdir -p $RPM_BUILD_ROOT%{_initrddir}
%{__cp} -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/shibd-%{_vendor} $RPM_BUILD_ROOT%{_initrddir}/shibd
%{!?_without_builtinapache:/etc/init.d/httpd status 1>/dev/null && /etc/init.d/httpd restart 1>/dev/null}
fi
%endif
-
%if "%{_vendor}" == "suse"
+ # This adds the proper /etc/rc*.d links for the script
+ /sbin/chkconfig --add shibd
+ cd /usr/sbin && ln -s /etc/init.d/shibd rcshibd
# On upgrade, restart components if they're already running.
if [ "$1" -gt "1" ] ; then
+ /etc/init.d/shibd status 1>/dev/null && /etc/init.d/shibd restart 1>/dev/null
%{!?_without_builtinapache:/etc/init.d/apache2 status 1>/dev/null && /etc/init.d/apache2 restart 1>/dev/null}
fi
%endif
/sbin/chkconfig --del shibd
fi
%endif
+%if "%{_vendor}" == "suse"
+ if [ "$1" = 0 ] ; then
+ /sbin/service shibd stop >/dev/null 2>&1
+ /sbin/chkconfig --del shibd
+ cd /usr/sbin && %{__rm} -f rcshibd
+ fi
+%endif
%ifnos solaris2.8 solaris2.9 solaris2.10
%postun -p /sbin/ldconfig
%if "%{_vendor}" == "redhat"
%attr(755, root, root) %{_initrddir}/shibd
%endif
+%if "%{_vendor}" == "suse"
+%attr(755, root, root) %{_initddir}/shibd
+%endif
%{_sysconfdir}/%{name}/*.dist
%{_sysconfdir}/%{name}/apache*.config
%{_sysconfdir}/%{name}/shibd-*
%doc %{pkgdocdir}/api
%changelog
-* Sat Aug 8 2009 Scott Cantor <cantor.2@osu.edu> - 2.2.1-1
+* Mon Aug 10 2009 Scott Cantor <cantor.2@osu.edu> - 2.2.1-1
- Doc handling changes
+- SuSE init script
* Tue Aug 4 2009 Scott Cantor <cantor.2@osu.edu> - 2.2.1-1
- Initial version for 2.2.1, with shibd/httpd restart on upgrade