#!/bin/sh # # chkconfig: - 92 34 # description: Starts and stops the Samba Winbindd daemon \ # used to provide seamless NT domain integration. # Do not load RH compatibility interface. WITHOUT_RC_COMPAT=1 # Source function library. . /etc/init.d/functions # Source networking configuration. SourceIfNotEmpty /etc/sysconfig/network # Check that smb.conf exists. [ -s /etc/samba/smb.conf ] || exit # msg_ export TMPDIR=/tmp LOCKFILE=/var/lock/subsys/winbind RETVAL=0 start() { is_yes "$NETWORKING" || return 0 echo -n "Starting Winbind services: " start-stop-daemon --start --quiet --exec /usr/sbin/winbindd -- -B RETVAL=$? if [ $RETVAL -eq 0 ] ; then touch "$LOCKFILE" success "Winbind startup" else RETVAL=1 failure "Winbind startup" fi echo return $RETVAL } stop() { echo -n "Shutting down Winbind services: " smbcontrol winbindd shutdown >/dev/null 2>&1 RETVAL=$? if [ $RETVAL -eq 0 ] ; then success "Winbind shutdown" rm -f "$LOCKFILE" else RETVAL=1 failure "Winbind shutdown" fi echo return $RETVAL } restart() { stop start } reload() { echo -n "Reloading smb.conf file: " smbcontrol winbindd reload-config >/dev/null 2>&1 RETVAL=$? [ $RETVAL -eq 0 ] && success "Winbind config reload" [ $RETVAL -eq 0 ] || failure "winbind config reload" echo return $RETVAL } # See how we were called. case "$1" in start) start ;; stop) stop ;; reload) reload ;; restart) restart ;; condstop) if [ -e "$LOCKFILE" ]; then stop fi ;; condrestart) if [ -e "$LOCKFILE" ]; then restart fi ;; status) status winbindd RETVAL=$? [ $RETVAL -eq 0 ] || RETVAL=1 ;; *) msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|status}" RETVAL=1 esac exit $RETVAL