2002-10-21 19:24:16 +04:00
#!/bin/sh
#
2003-08-29 08:09:21 +04:00
# chkconfig: 345 91 45
2002-10-21 19:24:16 +04:00
# description: Starts and stops the Samba winbind daemon to provide \
# user and group information from a domain controller to linux.
# Source function library.
if [ -f /etc/init.d/functions ] ; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
. /etc/rc.d/init.d/functions
else
exit 0
fi
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
2003-07-25 06:24:47 +04:00
CONFIG=/etc/samba/smb.conf
2002-10-21 19:24:16 +04:00
# Check that smb.conf exists.
2003-07-11 19:09:57 +04:00
[ -f $CONFIG ] || exit 0
2002-10-21 19:24:16 +04:00
start() {
echo -n "Starting Winbind services: "
2005-03-18 18:58:47 +03:00
daemon winbindd
RETVAL=$?
2002-10-21 19:24:16 +04:00
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/winbind || \
RETVAL=1
return $RETVAL
}
stop() {
echo -n "Shutting down Winbind services: "
2005-03-18 18:58:47 +03:00
killproc winbindd
RETVAL=$?
2002-10-21 19:24:16 +04:00
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/winbind
return $RETVAL
}
restart() {
stop
start
}
reload() {
export TMPDIR="/var/tmp"
echo -n "Checking domain trusts: "
killproc winbindd -HUP
RETVAL=$?
echo
return $RETVAL
}
mdkstatus() {
status winbindd
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
status)
mdkstatus
;;
condrestart)
[ -f /var/lock/subsys/winbindd ] && restart || :
;;
*)
echo "Usage: $0 {start|stop|restart|status|condrestart}"
exit 1
esac
exit $?