2 # ctdb event script for Samba
4 PATH=/bin:/usr/bin:$PATH
12 [ "$CTDB_MANAGES_SAMBA" = "yes" ] || exit 0
16 # wait for all shared directories to become available
17 smb_dirs=`testparm -st 2> /dev/null | egrep '^\s*path = ' | cut -d= -f2`
18 ctdb_wait_directories "Samba" $smb_dirs
20 # make sure samba is not already started
21 service smb stop > /dev/null 2>&1
22 service winbind stop > /dev/null 2>&1
24 # start Samba service. Start it reniced, as under very heavy load
25 # the number of smbd processes will mean that it leaves few cycles for
27 nice service smb start
30 # wait for the Samba tcp ports to become available
31 smb_ports=`testparm -stv 2> /dev/null | egrep '\s*smb ports =' | cut -d= -f2`
32 ctdb_wait_tcp_ports "Samba" $smb_ports
36 # nothing special for Samba
40 # nothing special for Samba
44 # nothing special for Samba
49 # shutdown Samba when ctdb goes down
55 # ignore unknown commands