]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/initscripts/init.d/nfs-server
Merge remote-tracking branch 'mfischer/slang' into next
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / nfs-server
1 #!/bin/sh
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 . /var/ipfire/nfs/nfs-server
13
14 case "$1" in
15 start)
16 boot_mesg "Starting NFS mountd..."
17 loadproc /usr/sbin/rpc.mountd
18
19 boot_mesg "Starting NFS nfsd..."
20 loadproc /usr/sbin/rpc.nfsd -p $PORT $PROCESSES
21
22 boot_mesg "Starting NFS statd..."
23 loadproc /usr/sbin/rpc.statd
24
25 if [ "$QUOTAS" = "yes" ]; then
26 boot_mesg "Starting NFS rquotad..."
27 loadproc /usr/sbin/rpc.rquotad
28 fi
29
30 boot_mesg "Mounting nfsd virtual filesystem..."
31 /bin/mount -t nfsd none /proc/fs/nfsd 2>&1 > /dev/null
32 evaluate_retval
33
34 # Make ceratin that the list is refreshed on
35 # a restart.
36 boot_mesg "Exporting NFS Filesystems..."
37 /usr/sbin/exportfs -ra 2>&1 > /dev/null
38 evaluate_retval
39 ;;
40
41 stop)
42 boot_mesg "Stopping NFS statd..."
43 killproc /usr/sbin/rpc.statd
44
45 boot_mesg "Stopping NFS nfsd..."
46 # nfsd needs HUP....
47 killproc nfsd HUP
48
49 boot_mesg "Stopping NFS mountd..."
50 killproc /usr/sbin/rpc.mountd
51
52 if [ "$QUOTAS" = "yes" ]; then
53 boot_mesg "Stopping NFS rquotad..."
54 killproc /usr/sbin/rpc.rquotad
55 fi
56
57 boot_mesg "Refreshing NFS Exported Filesystems..."
58 /usr/sbin/exportfs -au 2>&1 > /dev/null
59 evaluate_retval
60
61 boot_mesg "Unmounting NFS Virtual Filesystem..."
62 /bin/umount /proc/fs/nfsd 2>&1 > /dev/null
63 evaluate_retval
64
65 # Remove a pid file that isn't done automatically
66 boot_mesg "Removing the rpc.statd pid file if it exists"
67 if [ -f /var/run/rpc.statd.pid ]; then
68 rm -f /var/run/rpc.statd.pid
69 fi
70 ;;
71
72 reload)
73 boot_mesg "Reloading NFS Server..."
74 /usr/sbin/exportfs -ra
75 evaluate_retval
76 ;;
77
78 restart)
79 $0 stop
80 sleep 1
81 $0 start
82 ;;
83
84 status)
85 statusproc /usr/sbin/rpc.mountd
86 ## Special case for nfsd with no full path
87 statusproc nfsd
88 statusproc /usr/sbin/rpc.statd
89 if [ "$QUOTA" = "yes" ]; then
90 statusproc rpc.rquotad
91 fi
92 ;;
93
94 *)
95 echo "Usage: $0 {start|stop|reload|restart|status}"
96 exit 1
97 ;;
98 esac
99
100 # End $rc_base/init.d/nfs-server