From 17cd7ba917d71fdb81fc6f1a93f345f72b264aec Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 28 Sep 2014 23:05:51 +0200 Subject: fix nfs-utils startup --- package/nfs-utils/files/nfs-utils-server.init | 48 +++++++++++++++++++++++ package/nfs-utils/files/nfs-utils-server.postinst | 2 +- package/nfs-utils/files/nfsd.init | 48 ----------------------- 3 files changed, 49 insertions(+), 49 deletions(-) create mode 100644 package/nfs-utils/files/nfs-utils-server.init delete mode 100644 package/nfs-utils/files/nfsd.init diff --git a/package/nfs-utils/files/nfs-utils-server.init b/package/nfs-utils/files/nfs-utils-server.init new file mode 100644 index 000000000..a864c5430 --- /dev/null +++ b/package/nfs-utils/files/nfs-utils-server.init @@ -0,0 +1,48 @@ +#!/bin/sh +#PKG nfs-utils-server +#INIT 70 +. /etc/rc.conf + +case $1 in +autostop) ;; +autostart) + test x"${rpcbind:-NO}" = x"NO" && exit 0 + test x"${nfs_utils_server:-NO}" = x"NO" && exit 0 + test x"$nfs_utils_server" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start + exec sh $0 start + ;; +start) + mkdir -p /var/lib/nfs/v4recovery + touch /var/lib/nfs/rmtab + touch /var/lib/nfs/etab + touch /var/lib/nfs/xtab + touch /var/lib/nfs/sm + chown nfs:nfs /var/lib/nfs/sm + /usr/sbin/nfsd 4 + /usr/sbin/mountd + exportfs -a + if [ ${nfs_server_version} -eq 4 ];then + mkdir -p /var/lib/nfs/rpc_pipefs + mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs + /usr/sbin/idmapd + /usr/sbin/svcgssd + fi + ;; +stop) + kill $(pgrep -f /usr/sbin/mountd) + if [ ${nfs_server_version} -eq 4 ];then + kill $(pgrep -f /usr/sbin/idmapd) + kill $(pgrep -f /usr/sbin/svcgssd) + umount /var/lib/nfs/rpc_pipefs + fi + ;; +restart) + sh $0 stop + sh $0 start + ;; +*) + echo "Usage: $0 {start | stop | restart}" + exit 1 + ;; +esac +exit $? diff --git a/package/nfs-utils/files/nfs-utils-server.postinst b/package/nfs-utils/files/nfs-utils-server.postinst index 5c762993e..93532983a 100644 --- a/package/nfs-utils/files/nfs-utils-server.postinst +++ b/package/nfs-utils/files/nfs-utils-server.postinst @@ -1,4 +1,4 @@ #!/bin/sh . $IPKG_INSTROOT/etc/functions.sh -add_rcconf nfsd NO +add_rcconf nfs_utils_server NO add_rcconf nfs_server_version 3 diff --git a/package/nfs-utils/files/nfsd.init b/package/nfs-utils/files/nfsd.init deleted file mode 100644 index 2699b9dc3..000000000 --- a/package/nfs-utils/files/nfsd.init +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -#PKG nfs-utils-server -#INIT 70 -. /etc/rc.conf - -case $1 in -autostop) ;; -autostart) - test x"${rpcbind:-NO}" = x"NO" && exit 0 - test x"${nfsd:-NO}" = x"NO" && exit 0 - test x"$nfsd" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start - exec sh $0 start - ;; -start) - mkdir -p /var/lib/nfs/v4recovery - touch /var/lib/nfs/rmtab - touch /var/lib/nfs/etab - touch /var/lib/nfs/xtab - touch /var/lib/nfs/sm - chown nfs:nfs /var/lib/nfs/sm - /usr/sbin/nfsd 4 - /usr/sbin/mountd - exportfs -a - if [ ${nfs_server_version} -eq 4 ];then - mkdir -p /var/lib/nfs/rpc_pipefs - mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs - /usr/sbin/idmapd - /usr/sbin/svcgssd - fi - ;; -stop) - kill $(pgrep -f /usr/sbin/mountd) - if [ ${nfs_server_version} -eq 4 ];then - kill $(pgrep -f /usr/sbin/idmapd) - kill $(pgrep -f /usr/sbin/svcgssd) - umount /var/lib/nfs/rpc_pipefs - fi - ;; -restart) - sh $0 stop - sh $0 start - ;; -*) - echo "Usage: $0 {start | stop | restart}" - exit 1 - ;; -esac -exit $? -- cgit v1.2.3