Corrected the nfslock initscript 'status' return code (bz 441605) Removed
obsolete code from the nfslock initscript (bz 441604)
This commit is contained in:
parent
ed0365db60
commit
76623f83b7
@ -257,9 +257,11 @@ fi
|
||||
%attr(4755,root,root) /sbin/umount.nfs4
|
||||
|
||||
%changelog
|
||||
* Wed Apr 23 2008 Steve Dickson <steved@redhat.com> 1.1.2-3
|
||||
* Fri Apr 25 2008 Steve Dickson <steved@redhat.com> 1.1.2-3
|
||||
- Documented how to turn off/on protocol support for
|
||||
rpc.nfsd in /etc/sysconfig/nfs (bz443625)
|
||||
- Corrected the nfslock initscript 'status' return code (bz 441605)
|
||||
- Removed obsolete code from the nfslock initscript (bz 441604)
|
||||
|
||||
* Mon Apr 14 2008 Steve Dickson <steved@redhat.com> 1.1.2-2
|
||||
- Make EACCES a non fatal error (bz 439807)
|
||||
|
@ -15,6 +15,8 @@
|
||||
#RPCRQUOTADOPTS=""
|
||||
#
|
||||
#
|
||||
# Optional arguments passed to in-kernel lockd
|
||||
#LOCKDARG=
|
||||
# TCP port rpc.lockd should listen on.
|
||||
#LOCKD_TCPPORT=32803
|
||||
# UDP port rpc.lockd should listen on.
|
||||
|
61
nfslock.init
61
nfslock.init
@ -18,6 +18,8 @@ if [ ! -f /etc/sysconfig/network ]; then
|
||||
fi
|
||||
|
||||
# Check for and source configuration file
|
||||
LOCKDARG=""
|
||||
STATDARG=""
|
||||
[ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
|
||||
|
||||
. /etc/sysconfig/network
|
||||
@ -25,31 +27,9 @@ fi
|
||||
# Check that networking is up.
|
||||
[ "${NETWORKING}" = "no" ] && exit 6
|
||||
|
||||
# Start lockd from userland only if kernel <= 2.2.18
|
||||
OS_RELEASE=`uname --release`
|
||||
OS_RELEASE_MAJOR=`echo "$OS_RELEASE" | sed 's/\(^[0-9]\)\..*/\1/'`
|
||||
OS_RELEASE_MINOR=`echo "$OS_RELEASE" | sed 's/\(^[0-9]\)\.\([0-9]*\)\..*/\2/'`
|
||||
OS_RELEASE_VERSION=`echo "$OS_RELEASE" | sed 's/\(^[0-9]\)\.\([0-9]*\)\.\([0-9]*\).*/\3/'`
|
||||
|
||||
if [ "$OS_RELEASE_MAJOR" -le 2 -a "$OS_RELEASE_MINOR" -le 2 -a "$OS_RELEASE_VERSION" -le 18 ] ; then
|
||||
USERLAND_LOCKD="yes"
|
||||
else
|
||||
USERLAND_LOCKD=
|
||||
fi
|
||||
|
||||
if [ "$USERLAND_LOCKD" ] ; then
|
||||
[ -x /sbin/rpc.lockd ] || exit 5
|
||||
fi
|
||||
|
||||
[ -x /sbin/rpc.statd ] || exit 5
|
||||
|
||||
RETVAL=0
|
||||
if [ -n "${STATD_HOSTNAME}" ]; then
|
||||
STATDARG="-n ${STATD_HOSTNAME}"
|
||||
else
|
||||
STATDARG=""
|
||||
fi
|
||||
|
||||
|
||||
start() {
|
||||
if [ ! -f /var/lock/subsys/nfslock ]; then
|
||||
@ -58,26 +38,24 @@ start() {
|
||||
rm -f /var/run/sm-notify.pid
|
||||
|
||||
# Start daemons.
|
||||
if [ "$USERLAND_LOCKD" ]; then
|
||||
echo -n $"Starting NFS locking: "
|
||||
daemon rpc.lockd
|
||||
echo
|
||||
else
|
||||
# See if the kernel lockd should start up
|
||||
# listening on a particular port
|
||||
#
|
||||
LOCKDARG=""
|
||||
[ -n "$LOCKD_TCPPORT" ] && LOCKDARG="nlm_tcpport=$LOCKD_TCPPORT"
|
||||
[ -n "$LOCKD_UDPPORT" ] && \
|
||||
LOCKDARG="$LOCKDARG nlm_udpport=$LOCKD_UDPPORT"
|
||||
[ -n "$LOCKDARG" ] && \
|
||||
modprobe lockd $LOCKDARG
|
||||
fi
|
||||
[ -n "$LOCKD_TCPPORT" ] && \
|
||||
/sbin/sysctl -w fs.nfs.nlm_tcpport=$LOCKD_TCPPORT >/dev/null 2>&1
|
||||
[ -n "$LOCKD_UDPPORT" ] && \
|
||||
/sbin/sysctl -w fs.nfs.nlm_udpport=$LOCKD_UDPPORT >/dev/null 2>&1
|
||||
[ -n "$LOCKDARG" ] && modprobe lockd $LOCKDARG
|
||||
|
||||
echo -n $"Starting NFS statd: "
|
||||
# Set statd's local hostname if defined
|
||||
[ -n "${STATD_HOSTNAME}" ] && STATDARG="$STATDARG -n ${STATD_HOSTNAME}"
|
||||
|
||||
# See if a statd's ports has been defined
|
||||
[ -n "$STATD_PORT" ] && STATDARG="$STATDARG -p $STATD_PORT"
|
||||
[ -n "$STATD_OUTGOING_PORT" ] \
|
||||
&& STATDARG="$STATDARG -o $STATD_OUTGOING_PORT"
|
||||
|
||||
# See if we have an HA-callout program specified
|
||||
[ -n "$STATD_HA_CALLOUT" ] \
|
||||
&& STATDARG="$STATDARG -H $STATD_HA_CALLOUT"
|
||||
@ -115,26 +93,19 @@ case "$1" in
|
||||
stop
|
||||
;;
|
||||
status)
|
||||
if [ "$USERLAND_LOCKD" ]; then
|
||||
status lockd
|
||||
fi
|
||||
status rpc.statd
|
||||
RETVAL=$?
|
||||
;;
|
||||
restart)
|
||||
stop
|
||||
stop
|
||||
start
|
||||
;;
|
||||
probe)
|
||||
if [ ! -f /var/lock/subsys/nfslock ] ; then
|
||||
echo $"start"; exit 0
|
||||
fi
|
||||
/sbin/pidof rpc.statd >/dev/null 2>&1; STATD="$?"
|
||||
if [ "$USERLAND_LOCKD" ]; then
|
||||
/sbin/pidof lockd >/dev/null 2>&1; LOCKD="$?"
|
||||
else
|
||||
LOCKD=0
|
||||
fi
|
||||
if [ $STATD = 1 -o $LOCKD = 1 ] ; then
|
||||
/sbin/pidof rpc.statd >/dev/null 2>&1
|
||||
if [ $? = 1 ] ; then
|
||||
echo $"restart"; exit 0
|
||||
fi
|
||||
;;
|
||||
|
Loading…
Reference in New Issue
Block a user