diff options
author | Zhang Xiao <xiao.zhang@windriver.com> | 2013-11-21 16:07:24 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-12-09 18:01:44 +0000 |
commit | c0e048d33d5a5557ba24d74751aca7b000b16649 (patch) | |
tree | 533a51c9342854a62bb3ee62f9575d924e8d9441 /meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver | |
parent | fedd84f7eee7dba095459cde4df435975c7e6aac (diff) | |
download | poky-c0e048d33d5a5557ba24d74751aca7b000b16649.tar.gz |
nfs-utils: separate package as Debain style
Move binaries used for both nfs client and server into client
package. Add an init script for client package and move
necessary progress from server's init script to this one. Make
client package more powerful and let server package depends on
client one, as Debain does.
(From OE-Core rev: 39bb7e32c5eb930981392cec70a063e8dac152b7)
Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver')
-rw-r--r-- | meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver | 46 |
1 files changed, 3 insertions, 43 deletions
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver index c263f14f32..6e0df7e2ea 100644 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver | |||
@@ -1,8 +1,8 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | ### BEGIN INIT INFO | 2 | ### BEGIN INIT INFO |
3 | # Provides: nfs-kernel-server | 3 | # Provides: nfs-kernel-server |
4 | # Required-Start: $remote_fs $portmap hwclock | 4 | # Required-Start: $remote_fs nfs-common $portmap hwclock |
5 | # Required-Stop: $remote_fs $portmap hwclock | 5 | # Required-Stop: $remote_fs nfs-common $portmap hwclock |
6 | # Default-Start: 2 3 4 5 | 6 | # Default-Start: 2 3 4 5 |
7 | # Default-Stop: 0 1 6 | 7 | # Default-Stop: 0 1 6 |
8 | # Short-Description: Kernel NFS server support | 8 | # Short-Description: Kernel NFS server support |
@@ -24,8 +24,6 @@ test -r /etc/default/nfsd && . /etc/default/nfsd | |||
24 | # Location of executables: | 24 | # Location of executables: |
25 | test -x "$NFS_MOUNTD" || NFS_MOUNTD=/usr/sbin/rpc.mountd | 25 | test -x "$NFS_MOUNTD" || NFS_MOUNTD=/usr/sbin/rpc.mountd |
26 | test -x "$NFS_NFSD" || NFS_NFSD=/usr/sbin/rpc.nfsd | 26 | test -x "$NFS_NFSD" || NFS_NFSD=/usr/sbin/rpc.nfsd |
27 | test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd | ||
28 | test -z "$STATD_PID" && STATD_PID=/var/run/rpc.statd.pid | ||
29 | # | 27 | # |
30 | # The user mode program must also exist (it just starts the kernel | 28 | # The user mode program must also exist (it just starts the kernel |
31 | # threads using the kernel module code). | 29 | # threads using the kernel module code). |
@@ -36,34 +34,9 @@ test -x "$NFS_NFSD" || exit 0 | |||
36 | # ridiculous 99 | 34 | # ridiculous 99 |
37 | test "$NFS_SERVERS" != "" && test "$NFS_SERVERS" -gt 0 && test "$NFS_SERVERS" -lt 100 || NFS_SERVERS=8 | 35 | test "$NFS_SERVERS" != "" && test "$NFS_SERVERS" -gt 0 && test "$NFS_SERVERS" -lt 100 || NFS_SERVERS=8 |
38 | # | 36 | # |
39 | # The default state directory is /var/lib/nfs | ||
40 | test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs | ||
41 | # | ||
42 | #---------------------------------------------------------------------- | 37 | #---------------------------------------------------------------------- |
43 | # Startup and shutdown functions. | 38 | # Startup and shutdown functions. |
44 | # Actual startup/shutdown is at the end of this file. | 39 | # Actual startup/shutdown is at the end of this file. |
45 | #directories | ||
46 | create_directories(){ | ||
47 | echo -n 'creating NFS state directory: ' | ||
48 | mkdir -p "$NFS_STATEDIR" | ||
49 | ( cd "$NFS_STATEDIR" | ||
50 | umask 077 | ||
51 | mkdir -p sm sm.bak | ||
52 | test -w sm/state || { | ||
53 | rm -f sm/state | ||
54 | :>sm/state | ||
55 | } | ||
56 | umask 022 | ||
57 | for file in xtab etab smtab rmtab | ||
58 | do | ||
59 | test -w "$file" || { | ||
60 | rm -f "$file" | ||
61 | :>"$file" | ||
62 | } | ||
63 | done | ||
64 | ) | ||
65 | echo done | ||
66 | } | ||
67 | #mountd | 40 | #mountd |
68 | start_mountd(){ | 41 | start_mountd(){ |
69 | echo -n 'starting mountd: ' | 42 | echo -n 'starting mountd: ' |
@@ -124,17 +97,6 @@ stop_nfsd(){ | |||
124 | fi | 97 | fi |
125 | } | 98 | } |
126 | 99 | ||
127 | #statd | ||
128 | start_statd(){ | ||
129 | echo -n "starting statd: " | ||
130 | start-stop-daemon --start --exec "$NFS_STATD" --pidfile "$STATD_PID" | ||
131 | echo done | ||
132 | } | ||
133 | stop_statd(){ | ||
134 | echo -n 'stopping statd: ' | ||
135 | start-stop-daemon --stop --quiet --signal 1 --pidfile "$STATD_PID" | ||
136 | echo done | ||
137 | } | ||
138 | #---------------------------------------------------------------------- | 100 | #---------------------------------------------------------------------- |
139 | # | 101 | # |
140 | # supported options: | 102 | # supported options: |
@@ -144,13 +106,11 @@ stop_statd(){ | |||
144 | # restart: stops and starts mountd | 106 | # restart: stops and starts mountd |
145 | #FIXME: need to create the /var/lib/nfs/... directories | 107 | #FIXME: need to create the /var/lib/nfs/... directories |
146 | case "$1" in | 108 | case "$1" in |
147 | start) create_directories | 109 | start) |
148 | start_nfsd "$NFS_SERVERS" | 110 | start_nfsd "$NFS_SERVERS" |
149 | start_mountd | 111 | start_mountd |
150 | start_statd | ||
151 | test -r /etc/exports && exportfs -a;; | 112 | test -r /etc/exports && exportfs -a;; |
152 | stop) exportfs -ua | 113 | stop) exportfs -ua |
153 | stop_statd | ||
154 | stop_mountd | 114 | stop_mountd |
155 | stop_nfsd;; | 115 | stop_nfsd;; |
156 | status) | 116 | status) |