]>
Commit | Line | Data |
---|---|---|
559d3ad2 | 1 | #!/bin/sh |
66c36198 PM |
2 | ############################################################################### |
3 | # # | |
4 | # IPFire.org - A linux based firewall # | |
5 | # Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> # | |
6 | # # | |
7 | # This program is free software: you can redistribute it and/or modify # | |
8 | # it under the terms of the GNU General Public License as published by # | |
9 | # the Free Software Foundation, either version 3 of the License, or # | |
10 | # (at your option) any later version. # | |
11 | # # | |
12 | # This program is distributed in the hope that it will be useful, # | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # | |
15 | # GNU General Public License for more details. # | |
16 | # # | |
17 | # You should have received a copy of the GNU General Public License # | |
18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. # | |
19 | # # | |
20 | ############################################################################### | |
559d3ad2 MT |
21 | |
22 | . /etc/sysconfig/rc | |
23 | . $rc_functions | |
071e69cc | 24 | . /var/ipfire/nfs/nfs-server |
559d3ad2 MT |
25 | |
26 | case "$1" in | |
27 | start) | |
54cc2c4e | 28 | boot_mesg "Mounting nfsd virtual filesystem..." |
54ea98e3 MT |
29 | /bin/mount -t nfsd none /proc/fs/nfsd 2>&1 > /dev/null |
30 | evaluate_retval | |
54cc2c4e | 31 | |
559d3ad2 MT |
32 | boot_mesg "Starting NFS mountd..." |
33 | loadproc /usr/sbin/rpc.mountd | |
34 | ||
35 | boot_mesg "Starting NFS nfsd..." | |
36 | loadproc /usr/sbin/rpc.nfsd -p $PORT $PROCESSES | |
37 | ||
38 | boot_mesg "Starting NFS statd..." | |
39 | loadproc /usr/sbin/rpc.statd | |
40 | ||
41 | if [ "$QUOTAS" = "yes" ]; then | |
42 | boot_mesg "Starting NFS rquotad..." | |
43 | loadproc /usr/sbin/rpc.rquotad | |
44 | fi | |
45 | ||
559d3ad2 MT |
46 | # Make ceratin that the list is refreshed on |
47 | # a restart. | |
48 | boot_mesg "Exporting NFS Filesystems..." | |
49 | /usr/sbin/exportfs -ra 2>&1 > /dev/null | |
50 | evaluate_retval | |
51 | ;; | |
52 | ||
53 | stop) | |
54 | boot_mesg "Stopping NFS statd..." | |
55 | killproc /usr/sbin/rpc.statd | |
56 | ||
57 | boot_mesg "Stopping NFS nfsd..." | |
54cc2c4e JS |
58 | /usr/sbin/rpc.nfsd 0 |
59 | evaluate_retval | |
559d3ad2 MT |
60 | |
61 | boot_mesg "Stopping NFS mountd..." | |
62 | killproc /usr/sbin/rpc.mountd | |
63 | ||
64 | if [ "$QUOTAS" = "yes" ]; then | |
65 | boot_mesg "Stopping NFS rquotad..." | |
66 | killproc /usr/sbin/rpc.rquotad | |
67 | fi | |
68 | ||
69 | boot_mesg "Refreshing NFS Exported Filesystems..." | |
70 | /usr/sbin/exportfs -au 2>&1 > /dev/null | |
71 | evaluate_retval | |
72 | ||
2be0bc44 SS |
73 | boot_mesg "Unmounting NFS Virtual Filesystem..." |
74 | /bin/umount /proc/fs/nfsd 2>&1 > /dev/null | |
75 | evaluate_retval | |
559d3ad2 MT |
76 | |
77 | # Remove a pid file that isn't done automatically | |
78 | boot_mesg "Removing the rpc.statd pid file if it exists" | |
79 | if [ -f /var/run/rpc.statd.pid ]; then | |
80 | rm -f /var/run/rpc.statd.pid | |
81 | fi | |
82 | ;; | |
83 | ||
84 | reload) | |
85 | boot_mesg "Reloading NFS Server..." | |
86 | /usr/sbin/exportfs -ra | |
87 | evaluate_retval | |
88 | ;; | |
89 | ||
90 | restart) | |
91 | $0 stop | |
92 | sleep 1 | |
93 | $0 start | |
94 | ;; | |
95 | ||
96 | status) | |
97 | statusproc /usr/sbin/rpc.mountd | |
98 | ## Special case for nfsd with no full path | |
99 | statusproc nfsd | |
100 | statusproc /usr/sbin/rpc.statd | |
101 | if [ "$QUOTA" = "yes" ]; then | |
102 | statusproc rpc.rquotad | |
103 | fi | |
104 | ;; | |
105 | ||
106 | *) | |
107 | echo "Usage: $0 {start|stop|reload|restart|status}" | |
108 | exit 1 | |
109 | ;; | |
110 | esac |