From 6b00c90d709a01822027fb9986ec8ace605dd991 Mon Sep 17 00:00:00 2001 From: "\"Steven J. Hill\"" Date: Wed, 9 May 2007 22:48:41 +0000 Subject: Rename all INIT scripts to have the numerical prefixes to easily see the start-up order. --- package/nfs-utils/S60nfs | 89 ++++++++++++++++++++++++++++++++++++++++++ package/nfs-utils/init-nfs | 89 ------------------------------------------ package/nfs-utils/nfs-utils.mk | 2 +- 3 files changed, 90 insertions(+), 90 deletions(-) create mode 100755 package/nfs-utils/S60nfs delete mode 100755 package/nfs-utils/init-nfs (limited to 'package/nfs-utils') diff --git a/package/nfs-utils/S60nfs b/package/nfs-utils/S60nfs new file mode 100755 index 000000000..49dab7015 --- /dev/null +++ b/package/nfs-utils/S60nfs @@ -0,0 +1,89 @@ +#!/bin/sh +# +# nfs This shell script takes care of starting and stopping +# the NFS services. Stolen from RedHat FC5. + +[ -x /usr/sbin/rpc.statd ] || exit 0 +[ -x /usr/sbin/rpc.nfsd ] || exit 0 +[ -x /usr/sbin/rpc.mountd ] || exit 0 +[ -x /usr/sbin/exportfs ] || exit 0 + +# Don't fail if /etc/exports doesn't exist; create a bare-bones version and continue. +[ -r /etc/exports ] || \ + { touch /etc/exports && chmod u+rw,g+r,o+r /etc/exports ; } || \ + { echo "/etc/exports does not exist" ; exit 0 ; } + +# The /var/lib/nfs directory is actually on a tmpfs filesystem. +mkdir -p /var/lib/nfs/sm +mkdir -p /var/lib/nfs/sm.bak +touch /var/lib/nfs/etab +touch /var/lib/nfs/rmtab +touch /var/lib/nfs/state +touch /var/lib/nfs/xtab + +start() { + # Start daemons. + echo -n "Starting NFS statd: " + rpc.statd + touch /var/lock/subsys/nfslock + echo "done" + + echo -n "Starting NFS services: " + /usr/sbin/exportfs -r + rpc.statd + echo "done" + + echo -n "Starting NFS daemon: " + rpc.nfsd 2 + echo "done" + + echo -n "Starting NFS mountd: " + rpc.mountd + echo "done" + touch /var/lock/subsys/nfs +} + +stop() { + # Stop daemons. + echo -n "Shutting down NFS mountd: " + killall -q rpc.mountd + echo "done" + + echo "Shutting down NFS daemon: " + kill -9 `pidof nfsd` 2>/dev/null + echo "done" + + echo -n "Shutting down NFS services: " + /usr/sbin/exportfs -au + rm -f /var/lock/subsys/nfs + killall -q rpc.statd + echo "done" + + echo -n "Stopping NFS statd: " + killall -q rpc.statd + echo "done" + rm -f /var/lock/subsys/nfslock +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + reload) + /usr/sbin/exportfs -r + touch /var/lock/subsys/nfs + ;; + *) + echo "Usage: nfs {start|stop|reload}" + exit 1 +esac + +exit 0 diff --git a/package/nfs-utils/init-nfs b/package/nfs-utils/init-nfs deleted file mode 100755 index 49dab7015..000000000 --- a/package/nfs-utils/init-nfs +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/sh -# -# nfs This shell script takes care of starting and stopping -# the NFS services. Stolen from RedHat FC5. - -[ -x /usr/sbin/rpc.statd ] || exit 0 -[ -x /usr/sbin/rpc.nfsd ] || exit 0 -[ -x /usr/sbin/rpc.mountd ] || exit 0 -[ -x /usr/sbin/exportfs ] || exit 0 - -# Don't fail if /etc/exports doesn't exist; create a bare-bones version and continue. -[ -r /etc/exports ] || \ - { touch /etc/exports && chmod u+rw,g+r,o+r /etc/exports ; } || \ - { echo "/etc/exports does not exist" ; exit 0 ; } - -# The /var/lib/nfs directory is actually on a tmpfs filesystem. -mkdir -p /var/lib/nfs/sm -mkdir -p /var/lib/nfs/sm.bak -touch /var/lib/nfs/etab -touch /var/lib/nfs/rmtab -touch /var/lib/nfs/state -touch /var/lib/nfs/xtab - -start() { - # Start daemons. - echo -n "Starting NFS statd: " - rpc.statd - touch /var/lock/subsys/nfslock - echo "done" - - echo -n "Starting NFS services: " - /usr/sbin/exportfs -r - rpc.statd - echo "done" - - echo -n "Starting NFS daemon: " - rpc.nfsd 2 - echo "done" - - echo -n "Starting NFS mountd: " - rpc.mountd - echo "done" - touch /var/lock/subsys/nfs -} - -stop() { - # Stop daemons. - echo -n "Shutting down NFS mountd: " - killall -q rpc.mountd - echo "done" - - echo "Shutting down NFS daemon: " - kill -9 `pidof nfsd` 2>/dev/null - echo "done" - - echo -n "Shutting down NFS services: " - /usr/sbin/exportfs -au - rm -f /var/lock/subsys/nfs - killall -q rpc.statd - echo "done" - - echo -n "Stopping NFS statd: " - killall -q rpc.statd - echo "done" - rm -f /var/lock/subsys/nfslock -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - stop - start - ;; - reload) - /usr/sbin/exportfs -r - touch /var/lock/subsys/nfs - ;; - *) - echo "Usage: nfs {start|stop|reload}" - exit 1 -esac - -exit 0 diff --git a/package/nfs-utils/nfs-utils.mk b/package/nfs-utils/nfs-utils.mk index 36cc52347..b79a9e3d5 100644 --- a/package/nfs-utils/nfs-utils.mk +++ b/package/nfs-utils/nfs-utils.mk @@ -64,7 +64,7 @@ $(STAGING_DIR)/.fakeroot.nfs-utils: $(NFS_UTILS_DIR)/$(NFS_UTILS_BINARY) echo "$(MAKE) prefix=$(TARGET_DIR)/usr statedir=$(TARGET_DIR)/var/lib/nfs CC=$(TARGET_CC) -C $(NFS_UTILS_DIR) install" > $@ echo "rm -f $(TARGET_DIR)/usr/bin/event_rpcgen.py $(TARGET_DIR)/usr/sbin/nhfs* $(TARGET_DIR)/usr/sbin/nfsstat $(TARGET_DIR)/usr/sbin/showmount" >> $@ echo "rm -rf $(TARGET_DIR)/usr/share/man" >> $@ - echo "$(INSTALL) -m 0755 -D package/nfs-utils/init-nfs $(TARGET_DIR)/etc/init.d/S60nfs" >> $@ + echo "$(INSTALL) -m 0755 -D package/nfs-utils/S60nfs $(TARGET_DIR)/etc/init.d" >> $@ echo -n "for file in $(NFS_UTILS_TARGETS_) ; do rm -f $(TARGET_DIR)/" >> $@ echo -n "\$$" >> $@ echo "file; done" >> $@ -- cgit v1.2.3