]>
Commit | Line | Data |
---|---|---|
559d3ad2 MT |
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 | |
071e69cc | 12 | . /var/ipfire/nfs/nfs-server |
559d3ad2 MT |
13 | |
14 | case "$1" in | |
15 | start) | |
54cc2c4e | 16 | boot_mesg "Mounting nfsd virtual filesystem..." |
54ea98e3 MT |
17 | /bin/mount -t nfsd none /proc/fs/nfsd 2>&1 > /dev/null |
18 | evaluate_retval | |
54cc2c4e | 19 | |
559d3ad2 MT |
20 | boot_mesg "Starting NFS mountd..." |
21 | loadproc /usr/sbin/rpc.mountd | |
22 | ||
23 | boot_mesg "Starting NFS nfsd..." | |
24 | loadproc /usr/sbin/rpc.nfsd -p $PORT $PROCESSES | |
25 | ||
26 | boot_mesg "Starting NFS statd..." | |
27 | loadproc /usr/sbin/rpc.statd | |
28 | ||
29 | if [ "$QUOTAS" = "yes" ]; then | |
30 | boot_mesg "Starting NFS rquotad..." | |
31 | loadproc /usr/sbin/rpc.rquotad | |
32 | fi | |
33 | ||
559d3ad2 MT |
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..." | |
54cc2c4e JS |
46 | /usr/sbin/rpc.nfsd 0 |
47 | evaluate_retval | |
559d3ad2 MT |
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 | ||
2be0bc44 SS |
61 | boot_mesg "Unmounting NFS Virtual Filesystem..." |
62 | /bin/umount /proc/fs/nfsd 2>&1 > /dev/null | |
63 | evaluate_retval | |
559d3ad2 MT |
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 |