/[gentoo-alt]/trunk/sys-apps/freebsd-usbin/files/nfsmount.initd
Gentoo

Contents of /trunk/sys-apps/freebsd-usbin/files/nfsmount.initd

Parent Directory Parent Directory | Revision Log Revision Log


Revision 405 - (show annotations) (download)
Thu May 26 20:14:11 2005 UTC (8 years, 10 months ago) by flameeyes
File size: 1520 byte(s)
New revision: this time installs nfs and rpcbind init.d files, so you can use nfs with locking support.

1 #!/sbin/runscript
2 # Copyright 1999-2004 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header$
5
6 depend() {
7 need net rpcbind
8 use ypbind
9 }
10
11 start_statd() {
12 # Don't start rpc.statd if already started by init.d/nfs
13 killall -0 rpc.statd &>/dev/null && return 0
14 ebegin "Starting NFS statd"
15 rpc.statd
16 eend $? "Error starting NFS statd"
17 }
18
19 stop_statd() {
20 # Don't stop rpc.statd if it's in use by init.d/nfs
21 killall -0 nfsd &>/dev/null && return 0
22 # Make sure it's actually running
23 killall -0 rpc.statd &>/dev/null || return 0
24 # Okay, all tests passed, stop rpc.statd
25 ebegin "Stopping NFS statd"
26 killall rpc.statd
27 eend $? "Error stopping NFS statd"
28 }
29
30 start_lockd() {
31 # Don't start rpc.lockd if already started by init.d/nfs
32 killall -0 rpc.lockd &>/dev/null && return 0
33 ebegin "Starting NFS lockd"
34 rpc.lockd
35 eend $? "Error starting NFS lockd"
36 }
37
38 stop_lockd() {
39 # Don't stop rpc.lockd if it's in use by init.d/nfs
40 killall -0 nfsd &>/dev/null && return 0
41 # Make sure it's actually running
42 killall -0 rpc.lockd &>/dev/null || return 0
43 # Okay, all tests passed, stop rpc.lockd
44 ebegin "Stopping NFS lockd"
45 killall rpc.lockd
46 eend $? "Error stopping NFS lockd"
47 }
48
49 start() {
50 start_statd
51 start_lockd
52 ebegin "Mounting NFS filesystems"
53 mount -a -t nfs
54 eend $? "Error mounting NFS filesystems"
55 }
56
57 stop() {
58 ebegin "Unmounting NFS filesystems"
59 umount -a -t nfs
60 eend $? "Error unmounting NFS filesystems"
61 stop_statd
62 stop_lockd
63 }
64
65 restart() {
66 svc_stop
67 svc_start
68 }

Properties

Name Value
svn:eol-style native
svn:executable *
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20