remove winbindd from status
[Samba.git] / packaging / RedHat / smb.init
blobf50da2c6b2a86f801a3d28527cc19147a2552a1e
1 #!/bin/sh
3 # chkconfig: 345 91 35
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.
22 case "$1" in
23 start)
24 echo -n "Starting SMB services: "
25 daemon smbd -D
26 daemon nmbd -D
27 echo
28 touch /var/lock/subsys/smb
30 stop)
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
38 kill -TERM $pid
39 done
40 ## nmbd is ok to kill using killproc()
41 killproc nmbd -TERM
42 rm -f /var/lock/subsys/smb
43 echo ""
45 status)
46 status smbd
47 status nmbd
49 restart)
50 echo -n "Restarting SMB services: "
51 $0 stop
52 $0 start
53 echo "done."
56 echo "Usage: smb {start|stop|restart|status}"
57 exit 1
58 esac