diff options
author | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
commit | 972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch) | |
tree | 97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-extended/rpcbind/rpcbind/init.d | |
download | poky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz |
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-extended/rpcbind/rpcbind/init.d')
-rw-r--r-- | meta/recipes-extended/rpcbind/rpcbind/init.d | 87 |
1 files changed, 87 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..67499aa828 --- /dev/null +++ b/meta/recipes-extended/rpcbind/rpcbind/init.d | |||
@@ -0,0 +1,87 @@ | |||
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 | |||
19 | # Source function library. | ||
20 | . /etc/init.d/functions | ||
21 | |||
22 | test -f /sbin/rpcbind || exit 0 | ||
23 | |||
24 | OPTIONS="" | ||
25 | if [ -f /etc/default/rpcbind ] | ||
26 | then | ||
27 | . /etc/default/rpcbind | ||
28 | elif [ -f /etc/rpcbind.conf ] | ||
29 | then | ||
30 | . /etc/rpcbind.conf | ||
31 | fi | ||
32 | |||
33 | start () | ||
34 | { | ||
35 | echo -n "Starting rpcbind daemon..." | ||
36 | if pidof /sbin/rpcbind >/dev/null; then | ||
37 | echo "already running." | ||
38 | exit 0 | ||
39 | fi | ||
40 | start-stop-daemon --start --quiet --exec /sbin/rpcbind -- "$@" | ||
41 | if [ $? -eq 0 ]; then | ||
42 | echo "done." | ||
43 | else | ||
44 | echo "failed." | ||
45 | fi | ||
46 | } | ||
47 | |||
48 | stop () | ||
49 | { | ||
50 | echo "Stopping rpcbind daemon..." | ||
51 | if ! pidof /sbin/rpcbind >/dev/null; then | ||
52 | echo "not running." | ||
53 | return 0 | ||
54 | fi | ||
55 | start-stop-daemon --stop --quiet --exec /sbin/rpcbind | ||
56 | if [ $? -eq 0 ]; then | ||
57 | echo "done." | ||
58 | else | ||
59 | echo "failed." | ||
60 | fi | ||
61 | } | ||
62 | |||
63 | case "$1" in | ||
64 | start) | ||
65 | start $OPTIONS | ||
66 | ;; | ||
67 | stop) | ||
68 | stop | ||
69 | ;; | ||
70 | force-reload) | ||
71 | stop | ||
72 | start $OPTIONS | ||
73 | ;; | ||
74 | restart) | ||
75 | stop | ||
76 | start $OPTIONS | ||
77 | ;; | ||
78 | status) | ||
79 | status /sbin/rpcbind | ||
80 | ;; | ||
81 | *) | ||
82 | echo "Usage: /etc/init.d/rpcbind {start|stop|force-reload|restart|status}" | ||
83 | exit 1 | ||
84 | ;; | ||
85 | esac | ||
86 | |||
87 | exit $? | ||