3 # Start/stops the Samba daemons (nmbd and smbd).
10 # Reads config file (will override defaults above)
11 [ -r /etc
/default
/samba
] && .
/etc
/default
/samba
13 NMBDPID
=/var
/run
/samba
/nmbd.pid
14 SMBDPID
=/var
/run
/samba
/smbd.pid
16 # clear conflicting settings from the environment
19 # If Samba is running from inetd then there is nothing to do
20 if [ "$RUN_MODE" = "inetd" ]; then
21 # Commented out to close bug #26884 (startup message is rather long). I
22 # have yet to think how to let the user know that if he/she is running
23 # Samba from inetd, he can't just "/etc/init.d/samba stop" to stop
25 # echo "Warning: Samba is not running as daemons. Daemons not restarted/stopped."
26 # echo "Daemons will start automatically by inetd (if you wanted to start Samba)."
27 # echo "If you want to stop Samba, get the PID's of all nmbd and smbd processes"
28 # echo "and send them a SIGTERM signal but keep in mind that inetd could restart them."
32 # See if the daemons are there
33 test -x /usr
/sbin
/nmbd
-a -x /usr
/sbin
/smbd ||
exit 0
37 echo -n "Starting Samba daemons:"
40 start-stop-daemon
--start --quiet --exec /usr
/sbin
/nmbd
-- -D
43 start-stop-daemon
--start --quiet --exec /usr
/sbin
/smbd
-- -D
48 echo -n "Stopping Samba daemons:"
51 start-stop-daemon
--stop --quiet --pidfile $NMBDPID
54 start-stop-daemon
--stop --quiet --pidfile $SMBDPID
59 echo -n "Reloading /etc/samba/smb.conf (smbd only)"
60 start-stop-daemon
--stop --signal HUP
--pidfile $SMBDPID
65 echo -n "Restarting Samba daemons:"
68 start-stop-daemon
--stop --quiet --pidfile $NMBDPID
70 start-stop-daemon
--start --quiet --exec /usr
/sbin
/nmbd
-- -D
73 start-stop-daemon
--stop --quiet --pidfile $SMBDPID
75 start-stop-daemon
--start --quiet --exec /usr
/sbin
/smbd
-- -D
80 echo "Usage: /etc/init.d/samba {start|stop|reload|restart|force-reload}"