Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

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