[Samba] auto start

Roland Thompson roland at thompson.name
Mon Jan 13 21:14:01 GMT 2003

I did download and compile it, now looking at your config file actually
makes the book make sense.

Thank you

-----Original Message-----
From: Gordon Pritchard [mailto:gordonp at sfu.ca] 
Sent: 13 January 2003 21:05
To: roland at thompson.name
Cc: 'Kevin Kint'; samba at lists.samba.org
Subject: RE: [Samba] auto start

On Mon, 2003-01-13 at 12:52, Roland Thompson wrote:

> Thanks for the reply, but smb isn't one of the options.
> Any idea on how I can get it there?

	If you installed RedHat's samba rpm, everything should be set to

	If you downloaded and compiled stuff, then I can see this
What you need is a file - /etc/initd.d/samba  I'm including mine as a
reference for you (also RH 8; short, and ASCII).

====================Begin included samba init====================
# chkconfig: 345 91 35
# description: Starts and stops the Samba smbd and nmbd daemons \
#	       used to provide SMB network services.

# Source function library.
. /etc/rc.d/init.d/functions

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

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


# Check that smb.conf exists.
[ -f $CONFIG ] || exit 0

# See how we were called.
case "$1" in
	echo -n "Starting SMB services: "
	daemon smbd -D 	
	daemon nmbd -D 
	touch /var/lock/subsys/smb
	echo -n "Shutting down SMB services: "

	## we have to get all the smbd process here instead of just the
	## main parent (i.e. killproc) because it can take a long time
	## for an individual process to process a TERM signal
	smbdpids=`ps guax | grep smbd | grep -v grep | awk '{print $2}'`
	for pid in $smbdpids; do
		kill -TERM $pid
	## nmbd is ok to kill using killproc()
	killproc nmbd -TERM
	rm -f /var/lock/subsys/smb
	echo ""
	status smbd
	status nmbd
	echo -n "Restarting SMB services: "
	$0 stop
	$0 start
	echo "done."
	echo "Usage: smb {start|stop|restart|status}"
	exit 1

==================== End Included Text ====================

Gordon Pritchard, P.Eng.         | Institute of Electrical and
Research Labs Manager            |      Electronics Engineers
Simon Fraser University, Surrey  | Quarter Century Wireless Ass'n
gordonp at sfu.ca                   | Telephone Pioneers of America
phone:  604.586.6186

More information about the samba mailing list