Fix 244823

This commit is contained in:
Simo Sorce 2007-06-25 13:51:51 +00:00
parent 36d95f03d3
commit 0bcde84649
3 changed files with 25 additions and 19 deletions

View File

@ -14,7 +14,7 @@ if [ -f /etc/init.d/functions ] ; then
elif [ -f /etc/rc.d/init.d/functions ] ; then elif [ -f /etc/rc.d/init.d/functions ] ; then
. /etc/rc.d/init.d/functions . /etc/rc.d/init.d/functions
else else
exit 0 exit 1
fi fi
# Avoid using root's TMPDIR # Avoid using root's TMPDIR
@ -28,10 +28,10 @@ if [ -f /etc/sysconfig/samba ]; then
fi fi
# Check that networking is up. # Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0 [ ${NETWORKING} = "no" ] && exit 1
# Check that smb.conf exists. # Check that smb.conf exists.
[ -f /etc/samba/smb.conf ] || exit 0 [ -f /etc/samba/smb.conf ] || exit 6
RETVAL=0 RETVAL=0
@ -72,9 +72,7 @@ reload() {
rhstatus() { rhstatus() {
status nmbd status nmbd
if [ $? -ne 0 ] ; then return $?
return 1
fi
} }
@ -85,7 +83,7 @@ if [ "$1" = status ]; then
fi fi
# Check that we can write to it... so non-root users stop here # Check that we can write to it... so non-root users stop here
[ -w /etc/samba/smb.conf ] || exit 0 [ -w /etc/samba/smb.conf ] || exit 4
@ -110,7 +108,7 @@ case "$1" in
;; ;;
*) *)
echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}" echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}"
exit 1 exit 2
esac esac
exit $? exit $?

View File

@ -14,7 +14,7 @@ if [ -f /etc/init.d/functions ] ; then
elif [ -f /etc/rc.d/init.d/functions ] ; then elif [ -f /etc/rc.d/init.d/functions ] ; then
. /etc/rc.d/init.d/functions . /etc/rc.d/init.d/functions
else else
exit 0 exit 1
fi fi
# Avoid using root's TMPDIR # Avoid using root's TMPDIR
@ -28,10 +28,10 @@ if [ -f /etc/sysconfig/samba ]; then
fi fi
# Check that networking is up. # Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0 [ ${NETWORKING} = "no" ] && exit 1
# Check that smb.conf exists. # Check that smb.conf exists.
[ -f /etc/samba/smb.conf ] || exit 0 [ -f /etc/samba/smb.conf ] || exit 6
RETVAL=0 RETVAL=0
@ -72,9 +72,7 @@ reload() {
rhstatus() { rhstatus() {
status smbd status smbd
if [ $? -ne 0 ] ; then return $?
return 1
fi
} }
@ -85,7 +83,7 @@ if [ "$1" = status ]; then
fi fi
# Check that we can write to it... so non-root users stop here # Check that we can write to it... so non-root users stop here
[ -w /etc/samba/smb.conf ] || exit 0 [ -w /etc/samba/smb.conf ] || exit 4
@ -110,7 +108,7 @@ case "$1" in
;; ;;
*) *)
echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}" echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}"
exit 1 exit 2
esac esac
exit $? exit $?

View File

@ -17,10 +17,10 @@ unset TMPDIR
. /etc/sysconfig/network . /etc/sysconfig/network
# Check that networking is up. # Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0 [ ${NETWORKING} = "no" ] && exit 1
# Check that smb.conf exists. # Check that smb.conf exists.
[ -f /etc/samba/smb.conf ] || exit 0 [ -f /etc/samba/smb.conf ] || exit 6
[ -f /etc/sysconfig/samba ] && . /etc/sysconfig/samba [ -f /etc/sysconfig/samba ] && . /etc/sysconfig/samba
@ -63,8 +63,18 @@ reload() {
rhstatus() { rhstatus() {
status winbindd status winbindd
return $?
} }
# Allow status as non-root.
if [ "$1" = status ]; then
rhstatus
exit $?
fi
# Check that we can write to it... so non-root users stop here
[ -w /etc/samba/smb.conf ] || exit 4
case "$1" in case "$1" in
start) start)
start start
@ -86,7 +96,7 @@ case "$1" in
;; ;;
*) *)
echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}" echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}"
exit 1 exit 2
esac esac
exit $? exit $?