With System V, things can get a little more complex. System V typically uses scripts to start and stop daemons on the system. Hence, you need to instruct Samba how to operate when it starts and when it stops. You can modify the contents of the
/etc/rc.local directory and add something similar to the following program entitled
smb :
#!/bin/sh
# Contains the "killproc" function on Red Hat Linux
./etc/rc.d/init.d/functions
PATH="/usr/local/samba/bin:$PATH"
case $1 in
'start')
echo "Starting smbd..."
smbd -D
echo "Starting nmbd..."
nmbd -D
;;
'stop')
echo "Stopping smbd and nmbd..."
killproc smbd
killproc nmbd
rm -f /usr/local/samba/var/locks/smbd.pid
rm -f /usr/local/samba/var/locks/nmbd.pid
;;
*)
echo "usage: smb {start|stop}"
;;
esac
With this script, you can start and stop the SMB service with the following commands:
# /etc/rc.local/smb start
Starting smbd...
Starting nmbd...
# /etc/rc.local/smb stop
Stopping smbd and nmbd...