Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 - 1
#!/bin/bash
2
#
3
# rpcgssd       Start up and shut down RPCSEC GSS daemon
4
#
5
# chkconfig: 345 19 85
6
# description: Starts user-level daemon that manages RPCSEC GSS contexts \
7
#	       for the NFS client.
8
 
9
### BEGIN INIT INFO
10
# Provides: rpcgssd
11
# Required-Start: $network $syslog
12
# Required-Stop: $network $syslog
13
# Default-Start: 3 4 5
14
# Default-Stop: 0 1 6
15
# Short-Description: Starts the RPCSEC GSS client daemon
16
# Description: NFS is a popular protocol for file sharing across \
17
#          networks. This deamon manages RPCSEC GSS contexts on the
18
#          client used by secure NFS mounts
19
### END INIT INFO
20
 
21
# Source function library.
22
. /etc/init.d/functions
23
 
24
# Source networking configuration.
25
[ -f /etc/sysconfig/network ]&&  . /etc/sysconfig/network
26
 
27
# Check for and source configuration file otherwise set defaults
28
[ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
29
 
30
# Try to use machine credentials by default
31
RETVAL=0
32
uid=`id | cut -d\( -f1 | cut -d= -f2`
33
 
34
prog="rpc.gssd"
35
LOCKFILE=/var/lock/subsys/$prog
36
 
37
case "$1" in
38
  start|condstart)
39
	# Check that networking is up.
40
	[ "${NETWORKING}" != "yes" ] && exit 6
41
	[ ! -x /usr/sbin/rpc.gssd ] && exit 5
42
	# Only root can start the service
43
	[ $uid -ne 0 ] && exit 4
44
 
45
	# Make sure the daemon is not already running.
46
	if status $prog > /dev/null ; then
47
		exit 0
48
	fi
49
 
50
	# During condstart need to check again to see
51
	# if we are configured to start
52
	[ "${SECURE_NFS}" != "yes" ] && exit 6
53
 
54
	rm -f $LOCKFILE
55
	echo -n $"Starting RPC gssd: "
56
 
57
	# Make sure the rpc_pipefs filesystem is available
58
	/bin/mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs > /dev/null 2>&1
59
 
60
	[ -x /sbin/lsmod -a -x /sbin/modprobe ] && {
61
		if ! /sbin/lsmod | grep rpcsec_gss_krb5 > /dev/null ;  then
62
			/sbin/modprobe rpcsec_gss_krb5 || {
63
				echo "Error: Unable to load rpcsec_gss_krb5."
64
				exit 6;
65
			}
66
		fi
67
	}
68
 
69
	# Start daemon.
70
	daemon $prog ${RPCGSSDARGS}
71
	RETVAL=$?
72
	echo
73
	[ $RETVAL -eq 0 ] && touch $LOCKFILE
74
	;;
75
  stop)
76
	# Only root can stop the service
77
	[ $uid -ne 0 ] && exit 4
78
 
79
	# Stop daemon.
80
	echo -n $"Stopping RPC gssd: "
81
	killproc $prog
82
	RETVAL=$?
83
	echo
84
	rm -f $LOCKFILE
85
	;;
86
  status)
87
	status rpc.gssd
88
	RETVAL=$?
89
	;;
90
  restart|reload|force-reload)
91
	$0 stop
92
	$0 start
93
	RETVAL=$?
94
	;;
95
  condrestart|try-restart)
96
	if [ -f $LOCKFILE ]; then
97
		$0 restart
98
		RETVAL=$?
99
	fi
100
	;;
101
  condstop)
102
	if [ -f $LOCKFILE ]; then
103
		$0 stop
104
		RETVAL=$?
105
	fi
106
	;;
107
  *)
108
	echo $"Usage: $0 {start|stop|restart|force-reload|condstart|condrestart|try-restart|status|condstop}"
109
	RETVAL=2
110
	;;
111
esac
112
 
113
exit $RETVAL