Rev 4 | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/bin/sh## chkconfig: - 91 35# description: Starts and stops the Samba nmbd daemon \# used to provide NetBIOS name services.## pidfile: /var/run/samba/nmbd.pid# config: /etc/samba/smb.conf# Source function library.if [ -f /etc/init.d/functions ] ; then. /etc/init.d/functionselif [ -f /etc/rc.d/init.d/functions ] ; then. /etc/rc.d/init.d/functionselseexit 1fi# Avoid using root's TMPDIRunset TMPDIR# Source networking configuration.. /etc/sysconfig/networkif [ -f /etc/sysconfig/samba ]; then. /etc/sysconfig/sambafi# Check that networking is up.[ ${NETWORKING} = "no" ] && exit 1# Check that smb.conf exists.[ -f /etc/samba/smb.conf ] || exit 6RETVAL=0start() {KIND="NMB"echo -n $"Starting $KIND services: "daemon nmbd $NMBDOPTIONSRETVAL=$?echo[ $RETVAL -eq 0 ] && touch /var/lock/subsys/nmb || \RETVAL=1return $RETVAL}stop() {KIND="NMB"echo -n $"Shutting down $KIND services: "killproc nmbdRETVAL=$?echo[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/nmbreturn $RETVAL}restart() {stopstart}reload() {echo -n $"Reloading smb.conf file: "killproc nmbd -HUPRETVAL=$?echoreturn $RETVAL}rhstatus() {status -l nmb nmbdreturn $?}# Allow status as non-root.if [ "$1" = status ]; thenrhstatusexit $?fi# Check that we are root ... so non-root users stop here[ `id -u` -eq "0" ] || exit 4case "$1" instart)start;;stop)stop;;restart)restart;;reload)reload;;status)rhstatus;;condrestart)[ -f /var/lock/subsys/nmb ] && restart || :;;*)echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}"exit 2esacexit $?