3 # Start/stops the Samba daemons (nmbd and smbd).
5 # $Id: samba.init,v 1.1.2.5 2002/10/15 17:20:02 jerry Exp $
11 # Reads config file (will override defaults above)
12 [ -r /etc
/default
/samba
] && .
/etc
/default
/samba
14 NMBDPID
=/var
/run
/samba
/nmbd.pid
15 SMBDPID
=/var
/run
/samba
/smbd.pid
17 # clear conflicting settings from the environment
20 # If Samba is running from inetd then there is nothing to do
21 if [ "$RUN_MODE" = "inetd" ]; then
22 # Commented out to close bug #26884 (startup message is rather long). I
23 # have yet to think how to let the user know that if he/she is running
24 # Samba from inetd, he can't just "/etc/init.d/samba stop" to stop
26 # echo "Warning: Samba is not running as daemons. Daemons not restarted/stopped."
27 # echo "Daemons will start automatically by inetd (if you wanted to start Samba)."
28 # echo "If you want to stop Samba, get the PID's of all nmbd and smbd processes"
29 # echo "and send them a SIGTERM signal but keep in mind that inetd could restart them."
33 # See if the daemons are there
34 test -x /usr
/sbin
/nmbd
-a -x /usr
/sbin
/smbd ||
exit 0
38 echo -n "Starting Samba daemons:"
41 start-stop-daemon
--start --quiet --exec /usr
/sbin
/nmbd
-- -D
44 start-stop-daemon
--start --quiet --exec /usr
/sbin
/smbd
-- -D
49 echo -n "Stopping Samba daemons:"
52 start-stop-daemon
--stop --quiet --pidfile $NMBDPID
55 start-stop-daemon
--stop --quiet --pidfile $SMBDPID
60 echo -n "Reloading /etc/samba/smb.conf (smbd only)"
61 start-stop-daemon
--stop --signal HUP
--pidfile $SMBDPID
66 echo -n "Restarting Samba daemons:"
69 start-stop-daemon
--stop --quiet --pidfile $NMBDPID
71 start-stop-daemon
--start --quiet --exec /usr
/sbin
/nmbd
-- -D
74 start-stop-daemon
--stop --quiet --pidfile $SMBDPID
76 start-stop-daemon
--start --quiet --exec /usr
/sbin
/smbd
-- -D
81 echo "Usage: /etc/init.d/samba {start|stop|reload|restart|force-reload}"