Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 - 1
#! /bin/sh
2
#
3
# rpcbind       Start/Stop RPCbind
4
#
5
# chkconfig: 2345 13 87
6
# description: The rpcbind utility is a server that converts RPC program \
7
#              numbers into universal addresses. It must be running on the \
8
#              host to be able to make RPC calls on a server on that machine.
9
#
10
# processname: rpcbind
11
# probe: true
12
# config: /etc/sysconfig/rpcbind
13
 
14
 
15
# This is an interactive program, we need the current locale
16
[ -f /etc/profile.d/lang.sh ] && . /etc/profile.d/lang.sh
17
# We can't Japanese on normal console at boot time, so force LANG=C.
18
if [ "$LANG" = "ja" -o "$LANG" = "ja_JP.eucJP" ]; then
19
    if [ "$TERM" = "linux" ] ; then
20
        LANG=C
21
    fi
22
fi
23
 
24
# Source function library.
25
. /etc/init.d/functions
26
 
27
# Source networking configuration.
28
[ -f /etc/sysconfig/network ] &&  . /etc/sysconfig/network
29
 
30
prog="rpcbind"
31
[ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
32
 
33
RETVAL=0
34
uid=`id | cut -d\( -f1 | cut -d= -f2`
35
 
36
start() {
37
	# Check that networking is up.
38
	[ "$NETWORKING" = "yes" ] || exit 6
39
 
40
	[ -f /sbin/$prog ] || exit 5
41
 
42
	# Make sure the rpcbind is not already running.
43
	if status $prog > /dev/null ; then
44
		exit 0
45
	fi
46
 
47
	# Only root can start the service
48
	[ $uid -ne 0 ] && exit 4
49
 
50
	echo -n $"Starting $prog: "
51
	daemon $prog $1 "$RPCBIND_ARGS"
52
	RETVAL=$?
53
	echo
54
	if [ $RETVAL -eq 0 ] ; then
55
		touch /var/lock/subsys/$prog
56
		[ ! -f /var/run/rpcbind.pid ] &&
57
			/sbin/pidof $prog > /var/run/rpcbind.pid
58
	fi
59
	return $RETVAL
60
}
61
 
62
 
63
stop() {
64
	echo -n $"Stopping $prog: "
65
	killproc $prog
66
	RETVAL=$?
67
	echo
68
	[ $RETVAL -eq 0 ] && {
69
		rm -f /var/lock/subsys/$prog
70
		rm -f /var/run/rpcbind*
71
	}
72
	return $RETVAL
73
}
74
 
75
# See how we were called.
76
case "$1" in
77
  start)
78
	start
79
	RETVAL=$?
80
	;;
81
  stop)
82
	stop
83
	RETVAL=$?
84
	;;
85
  status)
86
	status $prog
87
	RETVAL=$?
88
	;;
89
  restart | reload| force-reload)
90
	stop
91
	start
92
	RETVAL=$?
93
	;;
94
  condrestart | try-restart)
95
	if [ -f /var/lock/subsys/$prog ]; then
96
		stop
97
		start -w
98
		RETVAL=$?
99
	fi
100
	;;
101
  *)
102
	echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|try-restart}"
103
	RETVAL=2
104
	;;
105
esac
106
 
107
exit $RETVAL