Just installing Alpha 17

Martin Ozolins mozolins at aaltoscientific.com
Tue Oct 18 15:14:01 MDT 2011


The package didn't include and init script.  I modified an older fedora 
one.  I've tested it on Centos 6, but is should work on any of them.

  Enjoy.

#!/bin/bash
#
# chkconfig: - 91 35
# description: Starts and stops the Samba smbd and nmbd daemons \
#	       used to provide SMB network services.
#
# pidfile: /usr/local/samba/var/run/samba.pid
# config:  /etc/samba/smb.conf


#set the path for the binaries
SMBPATH=/usr/local/samba

# 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

# Avoid using root's TMPDIR
unset TMPDIR

# Source networking configuration.
. /etc/sysconfig/network

if [ -f /etc/sysconfig/samba ]; then
    . /etc/sysconfig/samba
fi

# Check that networking is up.
[ ${NETWORKING} = "no" ]&&  exit 0

# Check that smb.conf exists.
[ -f /etc/samba/smb.conf ] || exit 0

RETVAL=0


start() {
         KIND="Samba"
	echo -n $"Starting $KIND services: "
	$SMBPATH/sbin/samba $SMBDOPTIONS
	RETVAL=$?
	echo
         [ $RETVAL -eq 0 ]&&  touch $SMBPATH/var/lock/samba || \
	   RETVAL=1
	return $RETVAL
}	

stop() {
         KIND="Samba"
	echo -n $"Shutting down $KIND services: "
	pkill -3 samba
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ]&&  rm -f $SMBPATH/var/lock/samba
	echo ""
	return $RETVAL
}	

restart() {
	stop
	start
}	

reload() {
         echo -n $"Reloading smb.conf file: "
	pkill -HUP samba
	RETVAL=$?
	echo
	return $RETVAL
}	

rhstatus() {
	$SMBPATH/bin/smbstatus
}	


# 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 0



case "$1" in
   start)
   	start
	;;
   stop)
   	stop
	;;
   restart)
   	restart
	;;
   reload)
   	reload
	;;
   status)
   	rhstatus
	;;
   condrestart)
   	[ -f $SMBPATH/var/lock/samba ]&&  restart || :
	;;
   *)
	echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}"
	exit 1
esac

exit $?



-- 
Martin Ozolins
Systems Administrator
mozolins at aaltoscientific.com
Aalto Scientific, Ltd.
1959 Kellogg Ave.
Carlsbad, CA 92008
tel: +1 760 431 7922, 125
fax: +1 760 431 6942
http://www.aaltoscientific.com

This message and any attachments are confidential and intended solely for the addressees. If you receive this message in error, please delete it and immediately notify the sender. If the reader of this message is not the intended recipient, you are hereby notified that any unauthorized use, copying or dissemination is prohibited. E-mails are susceptible to alteration. Neither Aalto Scientific Ltd., nor any of it subsidiaries or affiliates shall be liable for the message if altered, changed or falsified.



More information about the samba-technical mailing list