]> git.pld-linux.org Git - packages/rpcbind.git/blame - rpcbind.init
- portmap replacement
[packages/rpcbind.git] / rpcbind.init
CommitLineData
374a4481
JR
1#!/bin/sh
2#
3# rpcbind Start/Stop RPC universal addresses to RPC program number mapper
4#
5# chkconfig: 345 11 89
6#
7# description: The rpcbind utility is a server that converts RPC program \
8# numbers into universal addresses. It must be running on \
9# the host to be able to make RPC calls on a server on that \
10# machine.
11# processname: rpcbind
12
13
14# Source function library
15. /etc/rc.d/init.d/functions
16
17# Get network config
18. /etc/sysconfig/network
19
20# Get service config
21[ -f /etc/sysconfig/rpcbind ] && . /etc/sysconfig/rpcbind
22
23# Check that networking is up.
24if is_yes "${NETWORKING}"; then
25 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
26 msg_network_down rpcbind
27 exit 1
28 fi
29else
30 exit 0
31fi
32
33start() {
34 # Check if the service is already running?
35 if [ ! -f /var/lock/subsys/rpcbind ]; then
36 is_no "${RPCBIND_RPCUSER}" || RPCBIND_OPTIONS="${RPCBIND_OPTIONS} -s"
37 is_no "${RPCBIND_VERBOSE}" || RPCBIND_OPTIONS="${RPCBIND_OPTIONS} -l"
38 is_yes "${RPCBIND_INSECURE}" && RPCBIND_OPTIONS="${RPCBIND_OPTIONS} -i"
39 [ -z "${RPCBIND_ADDRESSES}" ] || \
40 for a in $RPCBIND_ADDRESSES ; do
41 RPCBIND_OPTIONS="${RPCBIND_OPTIONS} -h $a"
42 done
43 msg_starting rpcbind
44 daemon rpcbind ${RPCBIND_OPTIONS}
45 RETVAL=$?
46 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/rpcbind
47 else
48 msg_already_running rpcbind
49 fi
50}
51
52stop() {
53 if [ -f /var/lock/subsys/rpcbind ]; then
54 msg_stopping rpcbind
55 killproc rpcbind
56 rm -f /var/lock/subsys/rpcbind
57 else
58 msg_not_running rpcbind
59 fi
60}
61
62RETVAL=0
63# See how we were called.
64case "$1" in
65 start)
66 RPCBIND_OPTIONS=
67 start
68 ;;
69 stop)
70 stop
71 ;;
72 cleanup)
73 stop
74 RPCBIND_OPTIONS=
75 start
76 ;;
77 restart|force-reload)
78 stop
79 RPCBIND_OPTIONS="-w"
80 start
81 ;;
82 status)
83 status rpcbind
84 exit $?
85 ;;
86 *)
87 msg_usage "$0 {start|stop|restart|force-reload|cleanup|status}"
88 exit 3
89esac
90
91exit $RETVAL
This page took 0.033055 seconds and 4 git commands to generate.