2004-09-09 12:04:08 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2007-03-26 14:20:12 +00:00
|
|
|
# chkconfig: - 27 73
|
2004-09-09 12:04:08 +00:00
|
|
|
# description: Starts and stops the Samba winbind daemon
|
|
|
|
# #
|
2004-11-22 19:40:56 +00:00
|
|
|
# pidfile: /var/run/winbindd.pid
|
2004-09-09 12:04:08 +00:00
|
|
|
# config: /etc/samba/smb.conf
|
|
|
|
|
|
|
|
|
|
|
|
# Source function library.
|
2007-04-19 14:28:00 +00:00
|
|
|
. /etc/rc.d/init.d/functions
|
2004-09-09 12:04:08 +00:00
|
|
|
|
|
|
|
# Avoid using root's TMPDIR
|
|
|
|
unset TMPDIR
|
|
|
|
|
|
|
|
# Source networking configuration.
|
|
|
|
. /etc/sysconfig/network
|
|
|
|
|
|
|
|
# Check that networking is up.
|
2007-06-25 13:51:51 +00:00
|
|
|
[ ${NETWORKING} = "no" ] && exit 1
|
2004-09-09 12:04:08 +00:00
|
|
|
|
|
|
|
# Check that smb.conf exists.
|
2007-06-25 13:51:51 +00:00
|
|
|
[ -f /etc/samba/smb.conf ] || exit 6
|
2004-09-09 12:04:08 +00:00
|
|
|
|
2007-04-19 14:28:00 +00:00
|
|
|
[ -f /etc/sysconfig/samba ] && . /etc/sysconfig/samba
|
|
|
|
|
2004-09-09 12:04:08 +00:00
|
|
|
RETVAL=0
|
|
|
|
|
|
|
|
|
|
|
|
start() {
|
|
|
|
KIND="Winbind"
|
|
|
|
echo -n $"Starting $KIND services: "
|
|
|
|
daemon winbindd "$WINBINDOPTIONS"
|
|
|
|
RETVAL=$?
|
|
|
|
echo
|
|
|
|
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/winbindd || RETVAL=1
|
|
|
|
return $RETVAL
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
echo
|
|
|
|
KIND="Winbind"
|
|
|
|
echo -n $"Shutting down $KIND services: "
|
|
|
|
killproc winbindd
|
|
|
|
RETVAL=$?
|
|
|
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/winbindd
|
|
|
|
echo ""
|
|
|
|
return $RETVAL
|
|
|
|
}
|
|
|
|
|
|
|
|
restart() {
|
|
|
|
stop
|
|
|
|
start
|
|
|
|
}
|
|
|
|
|
|
|
|
reload() {
|
|
|
|
echo -n $"Reloading smb.conf file: "
|
|
|
|
killproc winbindd -HUP
|
|
|
|
RETVAL=$?
|
|
|
|
echo
|
|
|
|
return $RETVAL
|
|
|
|
}
|
|
|
|
|
|
|
|
rhstatus() {
|
|
|
|
status winbindd
|
2007-06-25 13:51:51 +00:00
|
|
|
return $?
|
2004-09-09 12:04:08 +00:00
|
|
|
}
|
|
|
|
|
2007-06-25 13:51:51 +00:00
|
|
|
# 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
|
|
|
|
|
2004-09-09 12:04:08 +00:00
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
stop
|
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
restart
|
|
|
|
;;
|
|
|
|
reload)
|
|
|
|
reload
|
|
|
|
;;
|
|
|
|
status)
|
|
|
|
rhstatus
|
|
|
|
;;
|
|
|
|
condrestart)
|
|
|
|
[ -f /var/lock/subsys/winbindd ] && restart || :
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}"
|
2007-06-25 13:51:51 +00:00
|
|
|
exit 2
|
2004-09-09 12:04:08 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
exit $?
|