Initscripts do not conform to LSB specification (bz 621562)

Signed-off-by: Steve Dickson <steved@redhat.com>
This commit is contained in:
Steve Dickson 2010-10-15 16:25:05 -04:00
parent 9c991d660c
commit 0fb3f74120
6 changed files with 96 additions and 49 deletions

View File

@ -2,7 +2,7 @@ Summary: NFS utilities and supporting clients and daemons for the kernel NFS ser
Name: nfs-utils Name: nfs-utils
URL: http://sourceforge.net/projects/nfs URL: http://sourceforge.net/projects/nfs
Version: 1.2.3 Version: 1.2.3
Release: 0.1%{?dist} Release: 2%{?dist}
Epoch: 1 Epoch: 1
# group all 32bit related archs # group all 32bit related archs
@ -251,6 +251,9 @@ fi
%attr(4755,root,root) /sbin/umount.nfs4 %attr(4755,root,root) /sbin/umount.nfs4
%changelog %changelog
* Fri Oct 15 2010 Steve Dickson <steved@redhat.com> 1.2.3-2
- Initscripts do not conform to LSB specification (bz 621562)
* Thu Oct 14 2010 Steve Dickson <steved@redhat.com> 1.2.3-1 * Thu Oct 14 2010 Steve Dickson <steved@redhat.com> 1.2.3-1
- Updated to latest upstream release: nfs-utils-1-2-4-rc1 - Updated to latest upstream release: nfs-utils-1-2-4-rc1

View File

@ -12,7 +12,7 @@
### BEGIN INIT INFO ### BEGIN INIT INFO
# Provides: nfs # Provides: nfs
# Required-Start: $local_fs $network $syslog # Required-Start: $local_fs $network $syslog $portmap
# Required-Stop: $local_fs $network $syslog # Required-Stop: $local_fs $network $syslog
# Default-Stop: 0 1 6 # Default-Stop: 0 1 6
# Short-Description: Start up the NFS server sevice # Short-Description: Start up the NFS server sevice
@ -35,6 +35,7 @@
[ -z "$RQUOTAD" ] && RQUOTAD=`type -path rpc.rquotad` [ -z "$RQUOTAD" ] && RQUOTAD=`type -path rpc.rquotad`
RETVAL=0 RETVAL=0
uid=`id | cut -d\( -f1 | cut -d= -f2`
# See how we were called. # See how we were called.
case "$1" in case "$1" in
@ -52,6 +53,9 @@ case "$1" in
exit 0 exit 0
fi fi
# Only root can start the service
[ $uid -ne 0 ] && exit 4
# Don't fail if /etc/exports doesn't exist; create a bare-bones # Don't fail if /etc/exports doesn't exist; create a bare-bones
# version and continue. # version and continue.
[ -r /etc/exports ] || \ [ -r /etc/exports ] || \
@ -119,24 +123,32 @@ case "$1" in
daemon rpc.mountd $RPCMOUNTDOPTS daemon rpc.mountd $RPCMOUNTDOPTS
RETVAL=$? RETVAL=$?
echo echo
touch /var/lock/subsys/nfs touch /var/lock/subsys/rpc.mountd
touch /var/lock/subsys/nfsd
# Let rpc.idmapd know that rpc.mountd just started # Let rpc.idmapd know that rpc.mountd just started
[ -x /usr/sbin/rpc.idmapd ] && /sbin/service rpcidmapd condstart [ -x /usr/sbin/rpc.idmapd ] && /sbin/service rpcidmapd condstart
;; ;;
stop) stop)
# Only root can stop the service
[ $uid -ne 0 ] && exit 4
# Stop daemons. # Stop daemons.
echo -n $"Shutting down NFS mountd: " echo -n $"Shutting down NFS mountd: "
killproc rpc.mountd killproc rpc.mountd
RETVAL=$?
echo echo
echo -n $"Shutting down NFS daemon: " echo -n $"Shutting down NFS daemon: "
killproc nfsd -2 killproc nfsd -2
rval=$?
[ $RETVAL -eq 0 ] && RETVAL=$rval
echo echo
if [ -n "$RQUOTAD" -a "$RQUOTAD" != "no" ]; then if [ -n "$RQUOTAD" -a "$RQUOTAD" != "no" ]; then
echo -n $"Shutting down NFS quotas: " echo -n $"Shutting down NFS quotas: "
killproc rpc.rquotad killproc rpc.rquotad
RETVAL=$? rval=$?
[ $RETVAL -eq 0 ] && RETVAL=$rval
echo echo
fi fi
# Reset the lockd ports if they were set # Reset the lockd ports if they were set
@ -151,31 +163,36 @@ case "$1" in
cnt=`/usr/sbin/exportfs -v | /usr/bin/wc -l` cnt=`/usr/sbin/exportfs -v | /usr/bin/wc -l`
if [ $cnt -gt 0 ]; then if [ $cnt -gt 0 ]; then
action $"Shutting down NFS services: " /usr/sbin/exportfs -au action $"Shutting down NFS services: " /usr/sbin/exportfs -au
else rval=$?
action $"Shutting down NFS services: " /bin/false [ $RETVAL -eq 0 ] && RETVAL=$rval
fi fi
[ -x /usr/sbin/rpc.svcgssd ] && /sbin/service rpcsvcgssd stop [ -x /usr/sbin/rpc.svcgssd ] && /sbin/service rpcsvcgssd stop
rm -f /var/lock/subsys/nfs rm -f /var/lock/subsys/nfsd
rm -f /var/lock/subsys/rpc.mountd
;; ;;
status) status)
[ -x /usr/sbin/rpc.svcgssd ] && /sbin/service rpcsvcgssd status [ -x /usr/sbin/rpc.svcgssd ] && /sbin/service rpcsvcgssd status
status rpc.mountd status rpc.mountd
RETVAL=$?
status nfsd status nfsd
rval=$?
[ $RETVAL -eq 0 ] && RETVAL=$rval
if [ -n "$RQUOTAD" -a "$RQUOTAD" != "no" ]; then if [ -n "$RQUOTAD" -a "$RQUOTAD" != "no" ]; then
status rpc.rquotad status rpc.rquotad
rval=$?
[ $RETVAL -eq 0 ] && RETVAL=$rval
fi fi
RETVAL=$?
;; ;;
restart) restart)
$0 stop $0 stop
$0 start $0 start
;; ;;
reload) reload | force-reload)
/usr/sbin/exportfs -r /usr/sbin/exportfs -r
touch /var/lock/subsys/nfs touch /var/lock/subsys/nfsd
;; ;;
probe) probe)
if [ ! -f /var/lock/subsys/nfs ] ; then if [ ! -f /var/lock/subsys/nfsd ] ; then
echo $"start"; exit 0 echo $"start"; exit 0
fi fi
/sbin/pidof rpc.mountd >/dev/null 2>&1; MOUNTD="$?" /sbin/pidof rpc.mountd >/dev/null 2>&1; MOUNTD="$?"
@ -183,13 +200,13 @@ case "$1" in
if [ $MOUNTD = 1 -o $NFSD = 1 ] ; then if [ $MOUNTD = 1 -o $NFSD = 1 ] ; then
echo $"restart"; exit 0 echo $"restart"; exit 0
fi fi
if [ /etc/exports -nt /var/lock/subsys/nfs ] ; then if [ /etc/exports -nt /var/lock/subsys/nfsd ] ; then
echo $"reload"; exit 0 echo $"reload"; exit 0
fi fi
;; ;;
condrestart) condrestart | try-restart)
[ -x /usr/sbin/rpc.svcgssd ] && /sbin/service rpcsvcgssd condrestart [ -x /usr/sbin/rpc.svcgssd ] && /sbin/service rpcsvcgssd condrestart
[ -f /var/lock/subsys/nfs ] && { [ -f /var/lock/subsys/nfsd ] && {
$0 stop $0 stop
$0 start $0 start
RETVAL=$? RETVAL=$?
@ -197,14 +214,14 @@ case "$1" in
;; ;;
condstop) condstop)
[ -x /usr/sbin/rpc.svcgssd ] && /sbin/service rpcsvcgssd condstop [ -x /usr/sbin/rpc.svcgssd ] && /sbin/service rpcsvcgssd condstop
[ -f /var/lock/subsys/nfs ] && { [ -f /var/lock/subsys/nfsd ] && {
$0 stop $0 stop
RETVAL=$? RETVAL=$?
} }
;; ;;
*) *)
echo $"Usage: nfs {start|stop|status|restart|reload|condrestart|condstop}" echo $"Usage: nfs {start|stop|status|restart|reload|force-reload|condrestart|try-restart|condstop}"
RETVAL=3 RETVAL=2
;; ;;
esac esac

View File

@ -11,7 +11,7 @@
### BEGIN INIT INFO ### BEGIN INIT INFO
# Provides: nfslock # Provides: nfslock
# Required-Start: $network $syslog # Required-Start: $network $syslog $portmap
# Required-Stop: $network $syslog # Required-Stop: $network $syslog
# Default-Start: 3 4 5 # Default-Start: 3 4 5
# Default-Stop: 0 1 6 # Default-Stop: 0 1 6
@ -36,6 +36,7 @@ STATDARG=""
[ -f /etc/sysconfig/network ] && . /etc/sysconfig/network [ -f /etc/sysconfig/network ] && . /etc/sysconfig/network
uid=`id | cut -d\( -f1 | cut -d= -f2`
RETVAL=0 RETVAL=0
start() { start() {
# Check that networking is up. # Check that networking is up.
@ -43,11 +44,14 @@ start() {
[ -x /sbin/rpc.statd ] || exit 5 [ -x /sbin/rpc.statd ] || exit 5
# Only root can start the service
[ $uid -ne 0 ] && exit 4
# Make sure the rpc.statd is not already running. # Make sure the rpc.statd is not already running.
if status rpc.statd > /dev/null ; then if status rpc.statd > /dev/null ; then
exit 0 exit 0
fi fi
rm -f /var/lock/subsys/nfslock rm -f /var/lock/subsys/rpc.statd
# Make sure locks are recovered # Make sure locks are recovered
rm -f /var/run/sm-notify.pid rm -f /var/run/sm-notify.pid
@ -79,11 +83,14 @@ start() {
daemon rpc.statd "$STATDARG" daemon rpc.statd "$STATDARG"
RETVAL=$? RETVAL=$?
echo echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/nfslock [ $RETVAL -eq 0 ] && touch /var/lock/subsys/rpc.statd
return $RETVAL return $RETVAL
} }
stop() { stop() {
# Only root can stop the service
[ $uid -ne 0 ] && exit 4
# Stop daemons. # Stop daemons.
if [ -n "`pidofproc lockd`" ]; then if [ -n "`pidofproc lockd`" ]; then
echo -n $"Stopping NFS locking: " echo -n $"Stopping NFS locking: "
@ -95,7 +102,7 @@ stop() {
killproc rpc.statd killproc rpc.statd
RETVAL=$? RETVAL=$?
echo echo
rm -f /var/lock/subsys/nfslock rm -f /var/lock/subsys/rpc.statd
rm -f /var/run/sm-notify.pid rm -f /var/run/sm-notify.pid
return $RETVAL return $RETVAL
} }
@ -112,12 +119,12 @@ case "$1" in
status rpc.statd status rpc.statd
RETVAL=$? RETVAL=$?
;; ;;
restart) restart | force-reload | reload)
stop stop
start start
;; ;;
probe) probe)
if [ ! -f /var/lock/subsys/nfslock ] ; then if [ ! -f /var/lock/subsys/rpc.statd ] ; then
echo $"start"; exit 0 echo $"start"; exit 0
fi fi
/sbin/pidof rpc.statd >/dev/null 2>&1 /sbin/pidof rpc.statd >/dev/null 2>&1
@ -125,22 +132,22 @@ case "$1" in
echo $"restart"; exit 0 echo $"restart"; exit 0
fi fi
;; ;;
condrestart) condrestart | try-restart)
[ -f /var/lock/subsys/nfslock ] && { [ -f /var/lock/subsys/rpc.statd ] && {
stop stop
start start
RETVAL=$? RETVAL=$?
} }
;; ;;
condstop) condstop)
[ -f /var/lock/subsys/nfslock ] && { [ -f /var/lock/subsys/rpc.statd ] && {
stop stop
RETVAL=$? RETVAL=$?
} }
;; ;;
*) *)
echo $"Usage: $0 {start|stop|status|restart|probe|condrestart|condstop}" echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|probe|condrestart|try-restart|condstop}"
RETVAL=3 RETVAL=2
;; ;;
esac esac

View File

@ -27,19 +27,20 @@
# Check for and source configuration file otherwise set defaults # Check for and source configuration file otherwise set defaults
[ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs [ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
# See if we are configured to start
[ "${SECURE_NFS}" != "yes" ] && exit 6
# Try to use machine credentials by default # Try to use machine credentials by default
RETVAL=0 RETVAL=0
LOCKFILE=/var/lock/subsys/rpcgssd uid=`id | cut -d\( -f1 | cut -d= -f2`
prog="rpc.gssd" prog="rpc.gssd"
LOCKFILE=/var/lock/subsys/$prog
case "$1" in case "$1" in
start|condstart) start|condstart)
# Check that networking is up. # Check that networking is up.
[ "${NETWORKING}" != "yes" ] && exit 6 [ "${NETWORKING}" != "yes" ] && exit 6
[ ! -x /usr/sbin/rpc.gssd ] && exit 5 [ ! -x /usr/sbin/rpc.gssd ] && exit 5
# Only root can start the service
[ $uid -ne 0 ] && exit 4
# Make sure the daemon is not already running. # Make sure the daemon is not already running.
if status $prog > /dev/null ; then if status $prog > /dev/null ; then
@ -94,6 +95,12 @@ case "$1" in
[ $RETVAL -eq 0 ] && touch $LOCKFILE [ $RETVAL -eq 0 ] && touch $LOCKFILE
;; ;;
stop) stop)
# Just exit if not configured
[ "${SECURE_NFS}" != "yes" ] && exit 6
# Only root can stop the service
[ $uid -ne 0 ] && exit 4
# Stop daemon. # Stop daemon.
echo -n $"Stopping RPC gssd: " echo -n $"Stopping RPC gssd: "
killproc $prog killproc $prog
@ -105,12 +112,12 @@ case "$1" in
status rpc.gssd status rpc.gssd
RETVAL=$? RETVAL=$?
;; ;;
restart|reload) restart|reload|force-reload)
$0 stop $0 stop
$0 start $0 start
RETVAL=$? RETVAL=$?
;; ;;
condrestart) condrestart|try-restart)
if [ -f $LOCKFILE ]; then if [ -f $LOCKFILE ]; then
$0 restart $0 restart
RETVAL=$? RETVAL=$?
@ -123,8 +130,8 @@ case "$1" in
fi fi
;; ;;
*) *)
echo $"Usage: $0 {start|stop|restart|condstart|condrestart|status|condstop}" echo $"Usage: $0 {start|stop|restart|force-reload|condstart|condrestart|try-restart|status|condstop}"
RETVAL=3 RETVAL=2
;; ;;
esac esac

View File

@ -28,8 +28,9 @@
[ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs [ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
RETVAL=0 RETVAL=0
LOCKFILE=/var/lock/subsys/rpcidmapd
prog="rpc.idmapd" prog="rpc.idmapd"
LOCKFILE=/var/lock/subsys/$prog
uid=`id | cut -d\( -f1 | cut -d= -f2`
case "$1" in case "$1" in
start|condstart) start|condstart)
@ -38,6 +39,9 @@ case "$1" in
[ ! -x /usr/sbin/rpc.idmapd ] && exit 5 [ ! -x /usr/sbin/rpc.idmapd ] && exit 5
# Only root can start the service
[ $uid -ne 0 ] && exit 4
# Make sure the daemon is not already running. # Make sure the daemon is not already running.
[ "$1" = "condstart" -a -n "`pidofproc $prog`" ] && { [ "$1" = "condstart" -a -n "`pidofproc $prog`" ] && {
killproc $prog "-SIGHUP" > /dev/null killproc $prog "-SIGHUP" > /dev/null
@ -78,6 +82,9 @@ case "$1" in
[ $RETVAL -eq 0 ] && touch $LOCKFILE [ $RETVAL -eq 0 ] && touch $LOCKFILE
;; ;;
stop) stop)
# Only root can stop the service
[ $uid -ne 0 ] && exit 4
# Stop daemon. # Stop daemon.
echo -n $"Stopping RPC idmapd: " echo -n $"Stopping RPC idmapd: "
killproc $prog killproc $prog
@ -89,12 +96,12 @@ case "$1" in
status rpc.idmapd status rpc.idmapd
RETVAL=$? RETVAL=$?
;; ;;
restart|reload) restart|reload|force-reload)
$0 stop $0 stop
$0 start $0 start
RETVAL=$? RETVAL=$?
;; ;;
condrestart) condrestart|try-restart)
if [ -f $LOCKFILE ]; then if [ -f $LOCKFILE ]; then
$0 restart $0 restart
RETVAL=$? RETVAL=$?
@ -107,8 +114,8 @@ case "$1" in
fi fi
;; ;;
*) *)
echo $"Usage: $0 {start|stop|restart|condstart|condrestart|status|condstop}" echo $"Usage: $0 {start|stop|restart|force-reload|condstart|condrestart|try-restart|status|condstop}"
RETVAL=3 RETVAL=2
;; ;;
esac esac

View File

@ -26,12 +26,10 @@
# Check for and source configuration file otherwise set defaults # Check for and source configuration file otherwise set defaults
[ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs [ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
# See if we are configured to start
[ "${SECURE_NFS}" != "yes" ] && exit 6
RETVAL=0 RETVAL=0
LOCKFILE=/var/lock/subsys/rpcsvcgssd
prog="rpc.svcgssd" prog="rpc.svcgssd"
LOCKFILE=/var/lock/subsys/$prog
uid=`id | cut -d\( -f1 | cut -d= -f2`
case "$1" in case "$1" in
start|condstart) start|condstart)
@ -39,6 +37,8 @@ case "$1" in
[ "${NETWORKING}" != "yes" ] && exit 6 [ "${NETWORKING}" != "yes" ] && exit 6
[ "${SECURE_NFS}" != "yes" ] && exit 6 [ "${SECURE_NFS}" != "yes" ] && exit 6
[ ! -x /usr/sbin/rpc.svcgssd ] && exit 5 [ ! -x /usr/sbin/rpc.svcgssd ] && exit 5
# Only root can start the service
[ $uid -ne 0 ] && exit 4
# Make sure the daemon is not already running. # Make sure the daemon is not already running.
if status $prog > /dev/null ; then if status $prog > /dev/null ; then
@ -91,6 +91,12 @@ case "$1" in
[ $RETVAL -eq 0 ] && touch $LOCKFILE [ $RETVAL -eq 0 ] && touch $LOCKFILE
;; ;;
stop) stop)
# Just exit if not configured
[ "${SECURE_NFS}" != "yes" ] && exit 6
# Only root can stop the service
[ $uid -ne 0 ] && exit 4
# Stop daemon. # Stop daemon.
echo -n $"Shutting down RPC svcgssd: " echo -n $"Shutting down RPC svcgssd: "
killproc $prog killproc $prog
@ -102,12 +108,12 @@ case "$1" in
status rpc.svcgssd status rpc.svcgssd
RETVAL=$? RETVAL=$?
;; ;;
restart|reload) restart|reload|force-reload)
$0 stop $0 stop
$0 start $0 start
RETVAL=$? RETVAL=$?
;; ;;
condrestart) condrestart|try-restart)
if [ -f $LOCKFILE ]; then if [ -f $LOCKFILE ]; then
$0 restart $0 restart
RETVAL=$? RETVAL=$?
@ -120,8 +126,8 @@ case "$1" in
fi fi
;; ;;
*) *)
echo $"Usage: $0 {start|stop|restart|condstart|condrestart|status|condstop}" echo $"Usage: $0 {start|stop|restart|force-reload|condstart|condrestart|try-restart|status|condstop}"
RETVAL=3 RETVAL=2
;; ;;
esac esac