diff -u pyro-3.7/debian/pyro.postrm pyro-3.7/debian/pyro.postrm --- pyro-3.7/debian/pyro.postrm +++ pyro-3.7/debian/pyro.postrm @@ -11,2 +11,6 @@ +if [ "$1" = "purge" ] ; then + update-rc.d pyro-esd remove >/dev/null || exit $? +fi + #DEBHELPER# diff -u pyro-3.7/debian/pyro.postinst pyro-3.7/debian/pyro.postinst --- pyro-3.7/debian/pyro.postinst +++ pyro-3.7/debian/pyro.postinst @@ -19,0 +20,8 @@ +if [ -x "/etc/init.d/pyro-esd" ]; then + update-rc.d pyro-esd defaults >/dev/null + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d pyro-esd start || exit $? + else + /etc/init.d/pyro-esd start || exit $? + fi +fi diff -u pyro-3.7/debian/pyro.prerm pyro-3.7/debian/pyro.prerm --- pyro-3.7/debian/pyro.prerm +++ pyro-3.7/debian/pyro.prerm @@ -13,6 +13,14 @@ fi fi +if [ -x "/etc/init.d/pyro-esd" ]; then + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d pyro-esd stop || exit $? + else + /etc/init.d/pyro-esd stop || exit $? + fi +fi + # Let's pycentral do its work then. #DEBHELPER# diff -u pyro-3.7/debian/pyro.pyro-nsd.init pyro-3.7/debian/pyro.pyro-nsd.init --- pyro-3.7/debian/pyro.pyro-nsd.init +++ pyro-3.7/debian/pyro.pyro-nsd.init @@ -4,7 +4,7 @@ # Required-Start: $time $local_fs $remote_fs $network # Required-Stop: $time $local_fs $remote_fs $network # Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 +# Default-Stop: 1 # Short-Description: Pyro name server daemon # Description: Debian init script for pyro-nsd (Pyro name server daemon) ### END INIT INFO diff -u pyro-3.7/debian/changelog pyro-3.7/debian/changelog --- pyro-3.7/debian/changelog +++ pyro-3.7/debian/changelog @@ -1,3 +1,10 @@ +pyro (3.7-2ubuntu1) intrepid; urgency=low + + * Added init script for pyro-nsd + * Modified init scripts to only shut down on runlevel 1 + + -- Jonathan Carter Thu, 03 Jul 2008 20:28:06 +0200 + pyro (3.7-2) unstable; urgency=medium [ Bernd Zeimetz ] diff -u pyro-3.7/debian/rules pyro-3.7/debian/rules --- pyro-3.7/debian/rules +++ pyro-3.7/debian/rules @@ -67,6 +67,8 @@ # in the same order (instead of reverse order), which fails for # python-central+init.d. dh_installinit --noscripts -ppyro --name=pyro-nsd + dh_installinit --noscripts -ppyro --name=pyro-esd + # some permissions that makes lintian/linda happier find debian/pyro-examples/usr/share/doc/pyro/examples -exec chmod a-x {} \; chmod 755 $(CURDIR)/debian/pyro-gui/`pycentral pycentraldir pyro-gui`/Pyro/wxnsc.py only in patch2: unchanged: --- pyro-3.7.orig/debian/pyro.pyro-esd.default +++ pyro-3.7/debian/pyro.pyro-esd.default @@ -0,0 +1,8 @@ +# /etc/default/pyro-esd + +# Change to one to enable pyro-esd +ENABLED=0 + +# Options to pass to pyro-esd +OPTIONS="" + only in patch2: unchanged: --- pyro-3.7.orig/debian/pyro.pyro-esd.init +++ pyro-3.7/debian/pyro.pyro-esd.init @@ -0,0 +1,73 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: pyro-esd +# Required-Start: $time $local_fs $remote_fs $network +# Required-Stop: $time $local_fs $remote_fs $network +# Default-Start: 2 3 4 5 +# Default-Stop: 1 +# Short-Description: Pyro name server daemon +# Description: Debian init script for pyro-esd (Pyro name server daemon) +### END INIT INFO + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/bin/pyro-esd +DESC="Pyro name server daemon" +NAME=pyro-esd + +test -x $DAEMON || exit 0 + +# Defaults - don't touch, edit /etc/default/pyro-esd +ENABLED=0 + +if [ -f /etc/default/pyro-esd ] ; then + . /etc/default/pyro-esd +fi + +if [ "$ENABLED" = "0" ]; then + echo "$DESC: disabled, see /etc/default/pyro-esd" + exit 0 +fi + +PYRO_NS=/usr/bin/pyro-esd +PYRO_PID=/var/run/pyro-esd.pid +END_PHRASE="python remote objects name service: pyro-esd" + +set -e + +case "$1" in + start) + echo -n "Starting $DESC: " + $DAEMON start $OPTIONS + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + $DAEMON stop + echo "$NAME." + ;; + restart|force-reload) + echo -n "Restarting $DESC: " + $DAEMON stop + sleep 1 + $DAEMON start $OPTIONS + echo "$NAME." + ;; + status) + STATUS="$($DAEMON status)" + echo "$STATUS" + if echo "$STATUS" | grep -q "not running"; then + if [ -f "$PYRO_PID" ]; then + exit 1 + else + exit 3 + fi + fi + ;; + *) + echo -n "Usage: /etc/init.d/pyro-esd " >&2 + echo "{start|stop|restart|force-reload|status}" >&2 + exit 1 + ;; +esac + +exit 0