4 # description: Starts and stops the Samba smbd and nmbd daemons \
5 # used to provide SMB network services.
7 # Source function library.
8 .
/etc
/rc.d
/init.d
/functions
10 # Source networking configuration.
11 .
/etc
/sysconfig
/network
13 # Check that networking is up.
14 [ ${NETWORKING} = "no" ] && exit 0
16 CONFIG
=/etc
/samba
/smb.conf
18 # Check that smb.conf exists.
19 [ -f $CONFIG ] ||
exit 0
21 # See how we were called.
24 echo -n "Starting SMB services: "
28 touch /var
/lock
/subsys
/smb
31 echo -n "Shutting down SMB services: "
33 ## we have to get all the smbd process here instead of just the
34 ## main parent (i.e. killproc) because it can take a long time
35 ## for an individual process to process a TERM signal
36 smbdpids
=`ps guax | grep smbd | grep -v grep | awk '{print $2}'`
37 for pid
in $smbdpids; do
40 ## nmbd is ok to kill using killproc()
42 rm -f /var
/lock
/subsys
/smb
50 echo -n "Restarting SMB services: "
56 echo "Usage: smb {start|stop|restart|status}"