]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/init.d/nfs-server
Hinzugefuegt:
[people/pmueller/ipfire-2.x.git] / src / init.d / nfs-server
1 #!/bin/sh
2 # Begin /etc/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: randy $
8 #$Date: 2006-04-29 22:26:35 -0500 (Sat, 29 Apr 2006) $
9
10 . /etc/init.d/init-functions
11 . /var/ipfire/nfs/nfs-server
12
13 case "$1" in
14 start)
15 boot_mesg "Starting NFS mountd..."
16 loadproc /usr/sbin/rpc.mountd
17
18 boot_mesg "Starting NFS nfsd..."
19 loadproc /usr/sbin/rpc.nfsd -p $PORT $PROCESSES
20
21 boot_mesg "Starting NFS statd..."
22 loadproc /usr/sbin/rpc.statd
23
24 if [ "$QUOTAS" = "yes" ]; then
25 boot_mesg "Starting NFS rquotad..."
26 loadproc /usr/sbin/rpc.rquotad
27 fi
28
29 # NFSD support only in 2.6 kernel
30 /bin/uname -r | /bin/grep "2.6" 2>&1 > /dev/null
31 if [ $? = 0 ]; then
32 boot_mesg "Mounting nfsd virtual filesystem..."
33 /bin/mount -t nfsd none /proc/fs/nfsd 2>&1 > /dev/null
34 evaluate_retval
35 fi
36
37 # Make ceratin that the list is refreshed on
38 # a restart.
39 boot_mesg "Exporting NFS Filesystems..."
40 /usr/sbin/exportfs -ra 2>&1 > /dev/null
41 evaluate_retval
42 ;;
43
44 stop)
45 boot_mesg "Stopping NFS statd..."
46 killproc /usr/sbin/rpc.statd
47
48 boot_mesg "Stopping NFS nfsd..."
49 # nfsd needs HUP....
50 TEMPSTOPSIG="$STOPSIG"
51 STOPSIG="HUP"
52 ## Special case for nfsd with no full path
53 killproc nfsd
54 # return STOPSIG to it's orginal value...
55 STOPSIG="$TEMPSTOPSIG"
56
57 boot_mesg "Stopping NFS mountd..."
58 killproc /usr/sbin/rpc.mountd
59
60 if [ "$QUOTAS" = "yes" ]; then
61 boot_mesg "Stopping NFS rquotad..."
62 killproc /usr/sbin/rpc.rquotad
63 fi
64
65 boot_mesg "Refreshing NFS Exported Filesystems..."
66 /usr/sbin/exportfs -au 2>&1 > /dev/null
67 evaluate_retval
68
69 # NFSD support only in 2.6 kernel
70 /bin/uname -r | /bin/grep "2.6" 2>&1 > /dev/null
71 if [ $? = 0 ]; then
72 boot_mesg "Unmounting NFS Virtual Filesystem..."
73 /bin/umount /proc/fs/nfsd 2>&1 > /dev/null
74 evaluate_retval
75 fi
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
111
112 # End /etc/init.d/nfs-server