diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2015-09-15 14:41:29 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2015-09-15 14:41:29 -0500 |
commit | 21f9b84b4b729fbd7acbd465e7a3f726e4d20f91 (patch) | |
tree | eb2d091d427ca0813b445509d59cc8e27e8ad25f /yocto-poky/meta/recipes-connectivity/portmap/portmap/portmap.init | |
parent | 101cef31e2bf54c678501155cd2106251acbd076 (diff) | |
parent | c124f4f2e04dca16a428a76c89677328bc7bf908 (diff) | |
download | talos-openbmc-21f9b84b4b729fbd7acbd465e7a3f726e4d20f91.tar.gz talos-openbmc-21f9b84b4b729fbd7acbd465e7a3f726e4d20f91.zip |
Merge commit 'c124f4f2e04dca16a428a76c89677328bc7bf908' as 'yocto-poky'
Diffstat (limited to 'yocto-poky/meta/recipes-connectivity/portmap/portmap/portmap.init')
-rwxr-xr-x | yocto-poky/meta/recipes-connectivity/portmap/portmap/portmap.init | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/yocto-poky/meta/recipes-connectivity/portmap/portmap/portmap.init b/yocto-poky/meta/recipes-connectivity/portmap/portmap/portmap.init new file mode 100755 index 000000000..621aa171a --- /dev/null +++ b/yocto-poky/meta/recipes-connectivity/portmap/portmap/portmap.init @@ -0,0 +1,67 @@ +#!/bin/sh +# +### BEGIN INIT INFO +# Provides: portmap +# Required-Start: $network +# Required-Stop: $network +# Default-Start: S 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: The RPC portmapper +# Description: Portmap is a server that converts RPC (Remote +# Procedure Call) program numbers into DARPA +# protocol port numbers. It must be running in +# order to make RPC calls. Services that use +# RPC include NFS and NIS. +### END INIT INFO + +test -f /sbin/portmap || exit 0 + +case "$1" in + start) + echo "Starting portmap daemon..." + start-stop-daemon --start --quiet --exec /sbin/portmap + + if [ -f /var/run/portmap.upgrade-state ]; then + echo "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 "Stopping portmap daemon..." + start-stop-daemon --stop --quiet --exec /sbin/portmap + ;; + reload) + ;; + force-reload) + $0 restart + ;; + restart) + # pmap_dump and pmap_set may be in a different package and not installed... + if [ -f /sbin/pmap_dump -a -f /sbin/pmap_set ]; then + do_state=1 + else + do_state=0 + fi + [ $do_state -eq 1 ] && pmap_dump >/var/run/portmap.state + $0 stop + $0 start + if [ $do_state -eq 1 ]; then + if [ ! -f /var/run/portmap.upgrade-state ]; then + sleep 1 + pmap_set </var/run/portmap.state + fi + rm -f /var/run/portmap.state + fi + ;; + *) + echo "Usage: /etc/init.d/portmap {start|stop|reload|restart}" + exit 1 + ;; +esac + +exit 0 + |