source: bootscripts-standard/cblfs/init.d/nfs-server@ 8bfe893

Last change on this file since 8bfe893 was 8bfe893, checked in by Joe Ciccone <jciccone@…>, 16 years ago

Change the way we kill nfsd.

  • Property mode set to 100644
File size: 3.1 KB
RevLine 
[7df280d]1#!/bin/bash
[7125722]2# Begin $rc_base/init.d/nfs-server
3
4# Based on sysklogd script from LFS-3.1 and earlier.
5# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
6
7#$LastChangedBy: bdubbs $
8#$Date: 2006-09-10 19:41:47 -0500 (Sun, 10 Sep 2006) $
9
10. /etc/sysconfig/rc
11. $rc_functions
12. /etc/sysconfig/nfs-server
13
14case "$1" in
15 start)
16 boot_mesg "Starting NFS mountd..."
17 loadproc /usr/sbin/rpc.mountd
18
[ad1a0bc]19 if [ "$NFS4" = "yes" ]; then
[eec6401]20 boot_mesg "Mounting rpc_pipefs virtual filesystem..."
21 /bin/mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs 2>&1 > /dev/null
22 evaluate_retval
23
[ad1a0bc]24 boot_mesg "Starting NFS4 idmapd..."
25 loadproc /usr/sbin/rpc.idmapd
26
27 boot_mesg "Starting NFS4 svcgssd..."
28 loadproc /usr/sbin/rpc.svcgssd
29 fi
30
[7125722]31 boot_mesg "Starting NFS nfsd..."
32 loadproc /usr/sbin/rpc.nfsd -p $PORT $PROCESSES
33
34 boot_mesg "Starting NFS statd..."
35 loadproc /usr/sbin/rpc.statd
36
37 if [ "$QUOTAS" = "yes" ]; then
38 boot_mesg "Starting NFS rquotad..."
39 loadproc /usr/sbin/rpc.rquotad
40 fi
41
42 # NFSD support only in 2.6 kernel
43 /bin/uname -r | /bin/grep "2.6" 2>&1 > /dev/null
44 if [ $? = 0 ]; then
45 boot_mesg "Mounting nfsd virtual filesystem..."
46 /bin/mount -t nfsd none /proc/fs/nfsd 2>&1 > /dev/null
47 evaluate_retval
48 fi
49
50 # Make ceratin that the list is refreshed on
51 # a restart.
52 boot_mesg "Exporting NFS Filesystems..."
53 /usr/sbin/exportfs -ra 2>&1 > /dev/null
54 evaluate_retval
55 ;;
56
57 stop)
58 boot_mesg "Stopping NFS statd..."
59 killproc /usr/sbin/rpc.statd
60
61 boot_mesg "Stopping NFS nfsd..."
[8bfe893]62 loadproc /usr/sbin/rpc.nfsd 0
[7125722]63
[ad1a0bc]64 if [ "$NFS4" = "yes" ]; then
65 boot_mesg "Stopping NFS svcgssd..."
66 killproc /usr/sbin/rpc.svcgssd
67
68 boot_mesg "Stopping NFS idmapd..."
69 killproc /usr/sbin/rpc.idmapd
[eec6401]70
71 boot_mesg "Unmounting rpc_pipefs virtual filesystem..."
72 /bin/umount /var/lib/nfs/rpc_pipefs 2>&1 > /dev/null
73 evaluate_retval
[ad1a0bc]74 fi
75
[7125722]76 boot_mesg "Stopping NFS mountd..."
77 killproc /usr/sbin/rpc.mountd
78
79 if [ "$QUOTAS" = "yes" ]; then
80 boot_mesg "Stopping NFS rquotad..."
81 killproc /usr/sbin/rpc.rquotad
82 fi
83
84 boot_mesg "Refreshing NFS Exported Filesystems..."
85 /usr/sbin/exportfs -au 2>&1 > /dev/null
86 evaluate_retval
87
88 # NFSD support only in 2.6 kernel
89 /bin/uname -r | /bin/grep "2.6" 2>&1 > /dev/null
90 if [ $? = 0 ]; then
91 boot_mesg "Unmounting NFS Virtual Filesystem..."
92 /bin/umount /proc/fs/nfsd 2>&1 > /dev/null
93 evaluate_retval
94 fi
95
96 # Remove a pid file that isn't done automatically
97 boot_mesg "Removing the rpc.statd pid file if it exists"
98 if [ -f /var/run/rpc.statd.pid ]; then
99 rm -f /var/run/rpc.statd.pid
100 fi
101 ;;
102
103 reload)
104 boot_mesg "Reloading NFS Server..."
105 /usr/sbin/exportfs -ra
106 evaluate_retval
107 ;;
108
109 restart)
110 $0 stop
111 sleep 1
112 $0 start
113 ;;
114
115 status)
116 statusproc /usr/sbin/rpc.mountd
117 ## Special case for nfsd with no full path
[ad1a0bc]118 if [ "$NFS4" = "yes" ]; then
119 statusproc /usr/sbin/rpc.idmapd
[91e0c48]120 statusproc /usr/sbin/rpc.svcgssd
[ad1a0bc]121 fi
[7125722]122 statusproc nfsd
123 statusproc /usr/sbin/rpc.statd
124 if [ "$QUOTA" = "yes" ]; then
125 statusproc rpc.rquotad
126 fi
127 ;;
128
129 *)
130 echo "Usage: $0 {start|stop|reload|restart|status}"
131 exit 1
132 ;;
133esac
134
135# End $rc_base/init.d/nfs-server
Note: See TracBrowser for help on using the repository browser.