summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/rpcbind/rpcbind/init.d
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/rpcbind/rpcbind/init.d')
-rw-r--r--meta/recipes-extended/rpcbind/rpcbind/init.d85
1 files changed, 85 insertions, 0 deletions
diff --git a/meta/recipes-extended/rpcbind/rpcbind/init.d b/meta/recipes-extended/rpcbind/rpcbind/init.d
new file mode 100644
index 0000000000..5c756bb523
--- /dev/null
+++ b/meta/recipes-extended/rpcbind/rpcbind/init.d
@@ -0,0 +1,85 @@
1#!/bin/sh
2#
3# start/stop rpcbind daemon.
4
5### BEGIN INIT INFO
6# Provides: rpcbind
7# Required-Start: $network
8# Required-Stop: $network
9# Default-Start: S 2 3 4 5
10# Default-Stop: 0 1 6
11# Short-Description: RPC portmapper replacement
12# Description: rpcbind is a server that converts RPC (Remote
13# Procedure Call) program numbers into DARPA
14# protocol port numbers. It must be running in
15# order to make RPC calls. Services that use
16# RPC include NFS and NIS.
17### END INIT INFO
18
19test -f /sbin/rpcbind || exit 0
20
21OPTIONS=""
22if [ -f /etc/default/rpcbind ]
23then
24 . /etc/default/rpcbind
25elif [ -f /etc/rpcbind.conf ]
26then
27 . /etc/rpcbind.conf
28fi
29
30start ()
31{
32 echo -n "Starting rpcbind daemon..."
33 if pidof /sbin/rpcbind >/dev/null; then
34 echo "already running."
35 exit 0
36 fi
37 start-stop-daemon --start --quiet --exec /sbin/rpcbind -- "$@"
38 if [ $? -eq 0 ]; then
39 echo "done."
40 else
41 echo "failed."
42 fi
43}
44
45stop ()
46{
47 echo "Stopping rpcbind daemon..."
48 if ! pidof /sbin/rpcbind >/dev/null; then
49 echo "not running."
50 exit 0
51 fi
52 start-stop-daemon --stop --quiet --exec /sbin/rpcbind
53 if [ $? -eq 0 ]; then
54 echo "done."
55 else
56 echo "failed."
57 fi
58}
59
60case "$1" in
61 start)
62 start $OPTIONS
63 ;;
64 stop)
65 stop
66 ;;
67 force-reload)
68 stop
69 start $OPTIONS
70 ;;
71 restart)
72 stop
73 start $OPTIONS
74 ;;
75 status)
76 pidof /sbin/rpcbind >/dev/null
77 exit $?
78 ;;
79 *)
80 echo "Usage: /etc/init.d/rpcbind {start|stop|force-reload|restart|status}"
81 exit 1
82 ;;
83esac
84
85exit 0