#!/bin/sh # # chkconfig: 345 91 35 # description: Starts and stops the Samba winbind daemon # # pidfile: /run/winbindd.pid # config: /etc/samba/smb.conf # source function library . /etc/sysconfig/rc . $rc_functions NAME=winbindd DAEMON=/usr/sbin/$NAME DAEMONPID=/run/$NAME.pid DAEMONCONF=/etc/samba/smb.conf OPTIONS="" [ -x $DAEMON ] || exit 0 # source networking configuration . /etc/sysconfig/network # check that networking is up [ ${NETWORKING} = "no" ] && exit 0 # avoid using root's TMPDIR unset TMPDIR [ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME # check that smb.conf exists [ -r $DAEMONCONF ] || exit 0 RETVAL=0 case "$1" in start) echo -n $"Starting $NAME: " daemon --pidfile=$DAEMONPID $DAEMON $OPTIONS RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME ;; stop) echo -n $"Stopping $NAME: " killproc -p $DAEMONPID $DAEMON RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$NAME $DAEMONPID ;; restart|force-reload) $0 stop sleep 1 $0 start ;; reload) echo -n "Reloading $NAME: " reloadproc $DAEMON echo ;; condrestart) [ -e /var/lock/subsys/$NAME ] && $0 restart || : ;; status) statusproc $DAEMON RETVAL=$? ;; *) echo $"Usage: ""/etc/init.d/$NAME {start|stop|status|reload|restart|condrestart}" exit 1 ;; esac exit $?