]>
Commit | Line | Data |
---|---|---|
2952a435 | 1 | #!/bin/sh |
8ca940f0 | 2 | # |
2952a435 | 3 | # gssd Start up and shut down RPCSEC GSS daemon |
8ca940f0 | 4 | # |
2952a435 JR |
5 | # chkconfig: 345 15 81 |
6 | # description: Starts user-level daemon that manages RPCSEC GSS contexts \ | |
7 | # for the NFSv4 client. | |
8ca940f0 JR |
8 | |
9 | # Source function library. | |
10 | . /etc/rc.d/init.d/functions | |
11 | ||
12 | # Get network config | |
13 | . /etc/sysconfig/network | |
14 | ||
15 | # Check that networking is up. | |
16 | if is_yes "${NETWORKING}"; then | |
17 | if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then | |
e1c8bafb | 18 | msg_network_down "RPC gssd" |
8ca940f0 JR |
19 | exit 1 |
20 | fi | |
21 | else | |
22 | exit 0 | |
23 | fi | |
24 | ||
25 | if [ -x /sbin/pidof ] && [ "$1" != "stop" ]; then | |
26 | [ -z "`/sbin/pidof portmap`" ] && nls "Error: portmap isn't running" && exit 0 | |
27 | fi | |
28 | ||
29 | # Get service config | |
30 | [ -f /etc/sysconfig/nfsfs ] && . /etc/sysconfig/nfsfs | |
31 | ||
32 | is_yes "${SECURE_NFS}" || exit 0 | |
33 | ||
34 | # List of kernel modules to load | |
35 | [ -z "${SECURE_NFS_MODS}" ] && SECURE_NFS_MODS="des rpcsec_gss_krb5" | |
36 | ||
37 | # /usr may be on NFS, fail silently, nfsfs will start it | |
38 | [ -x /usr/sbin/rpc.gssd ] || exit 0 | |
39 | ||
40 | RETVAL=0 | |
41 | ||
42 | # See how we were called. | |
43 | case "$1" in | |
44 | start) | |
45 | # Check if the service is already running? | |
4797294b | 46 | if [ ! -f /var/lock/subsys/gssd ]; then |
8ca940f0 JR |
47 | if ! grep -q rpc_pipefs /proc/mounts ; then |
48 | modprobe -s sunrpc >/dev/null 2>&1 | |
49 | run_cmd "Mounting /var/lib/nfs/rpc_pipefs filesystem" \ | |
50 | mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs | |
51 | fi | |
52 | # Load rpcsec modules | |
53 | for i in ${SECURE_NFS_MODS} ; do | |
54 | _modprobe single die $i | |
55 | done | |
56 | msg_starting "RPC gssd" | |
57 | daemon rpc.gssd $RPCGSSOPTIONS | |
58 | RETVAL=$? | |
4797294b | 59 | [ $RETVAL = 0 ] && touch /var/lock/subsys/gssd |
8ca940f0 JR |
60 | else |
61 | msg_already_running "RPC gssd" | |
62 | fi | |
63 | ;; | |
64 | stop) | |
4797294b | 65 | if [ -f /var/lock/subsys/gssd ]; then |
8ca940f0 JR |
66 | msg_stopping "RPC gssd" |
67 | killproc rpc.gssd | |
4797294b | 68 | rm -f /var/lock/subsys/gssd |
8ca940f0 JR |
69 | else |
70 | msg_not_running "RPC gssd" | |
71 | fi | |
72 | ;; | |
73 | status) | |
74 | status rpc.gssd | |
75 | RETVAL=$? | |
76 | ;; | |
77 | restart|reload) | |
78 | $0 stop | |
79 | $0 start | |
80 | RETVAL=$? | |
81 | ;; | |
82 | *) | |
83 | msg_usage "$0 {start|stop|restart|status}" | |
84 | exit 1 | |
85 | esac | |
86 | ||
87 | exit $RETVAL |