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
. /etc/rc.d/init.d/functions
else
exit 0
exit 1
fi
# Avoid using root's TMPDIR
@ -28,10 +28,10 @@ if [ -f /etc/sysconfig/samba ]; then
fi
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ ${NETWORKING} = "no" ] && exit 1
# Check that smb.conf exists.
[ -f /etc/samba/smb.conf ] || exit 0
[ -f /etc/samba/smb.conf ] || exit 6
RETVAL=0
@ -72,9 +72,7 @@ reload() {
rhstatus() {
status nmbd
if [ $? -ne 0 ] ; then
return 1
fi
return $?
}
@ -85,7 +83,7 @@ if [ "$1" = status ]; then
fi
# 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}"
exit 1
exit 2
esac
exit $?

View File

@ -14,7 +14,7 @@ if [ -f /etc/init.d/functions ] ; then
elif [ -f /etc/rc.d/init.d/functions ] ; then
. /etc/rc.d/init.d/functions
else
exit 0
exit 1
fi
# Avoid using root's TMPDIR
@ -28,10 +28,10 @@ if [ -f /etc/sysconfig/samba ]; then
fi
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ ${NETWORKING} = "no" ] && exit 1
# Check that smb.conf exists.
[ -f /etc/samba/smb.conf ] || exit 0
[ -f /etc/samba/smb.conf ] || exit 6
RETVAL=0
@ -72,9 +72,7 @@ reload() {
rhstatus() {
status smbd
if [ $? -ne 0 ] ; then
return 1
fi
return $?
}
@ -85,7 +83,7 @@ if [ "$1" = status ]; then
fi
# 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}"
exit 1
exit 2
esac
exit $?

View File

@ -17,10 +17,10 @@ unset TMPDIR
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ ${NETWORKING} = "no" ] && exit 1
# 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
@ -63,8 +63,18 @@ reload() {
rhstatus() {
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
start)
start
@ -86,7 +96,7 @@ case "$1" in
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}"
exit 1
exit 2
esac
exit $?