summaryrefslogtreecommitdiff
path: root/packages/portmap/files
diff options
context:
space:
mode:
authorJohn Bowler <jbowler@nslu2-linux.org>2005-05-23 16:05:53 +0000
committerJohn Bowler <jbowler@nslu2-linux.org>2005-05-23 16:05:53 +0000
commit8bc11aeda8d5540d1625fe46725178725e1826c1 (patch)
treed4428c7729234fce3c60d8e17c7aae6d44ac44bf /packages/portmap/files
parent5c0d7c846f43561e6d7a061e1b5194c326ab36e3 (diff)
Changes to make portmap shutdown happen on openslug
BKrev: 4291ff61BcZ82KNfnhcRu_VCLNBURA
Diffstat (limited to 'packages/portmap/files')
-rw-r--r--packages/portmap/files/portmap.init50
1 files changed, 50 insertions, 0 deletions
diff --git a/packages/portmap/files/portmap.init b/packages/portmap/files/portmap.init
index e69de29bb2..6dac207350 100644
--- a/packages/portmap/files/portmap.init
+++ b/packages/portmap/files/portmap.init
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+# start/stop portmap daemon.
+
+test -f /sbin/portmap || exit 0
+
+case "$1" in
+ start)
+ echo -n "Starting portmap daemon:"
+ echo -n " portmap"
+ start-stop-daemon --start --quiet --exec /sbin/portmap
+ echo "."
+
+ if [ -f /var/run/portmap.upgrade-state ]; then
+ echo -n "Restoring old RPC service information..."
+ sleep 1 # needs a short pause or pmap_set won't work. :(
+ pmap_set </var/run/portmap.upgrade-state
+ rm -f /var/run/portmap.upgrade-state
+ echo "done."
+ fi
+
+ ;;
+ stop)
+ echo -n "Stopping portmap daemon:"
+ echo -n " portmap" ; start-stop-daemon --stop --quiet --exec /sbin/portmap
+ echo "."
+ ;;
+ reload)
+ ;;
+ force-reload)
+ $0 restart
+ ;;
+ restart)
+ pmap_dump >/var/run/portmap.state
+ $0 stop
+ $0 start
+ if [ ! -f /var/run/portmap.upgrade-state ]; then
+ sleep 1
+ pmap_set </var/run/portmap.state
+ fi
+ rm -f /var/run/portmap.state
+ ;;
+ *)
+ echo "Usage: /etc/init.d/portmap {start|stop|reload|restart}"
+ exit 1
+ ;;
+esac
+
+exit 0
+