1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
samba-mirror/ctdb/config/events.d/samba
Andrew Tridgell e763874872 make the init scripts more portable about location of system config files
(This used to be ctdb commit 65f3e2bc722e314b2c51c3bfdc544b408a8a64cf)
2007-06-03 22:07:07 +10:00

51 lines
902 B
Bash

#!/bin/sh
# ctdb event script for Samba
PATH=/bin:/usr/bin:$PATH
. /etc/ctdb/functions
loadconfig ctdb
cmd="$1"
shift
[ "$CTDB_MANAGES_SAMBA" = "yes" ] || exit 0
case $cmd in
startup)
# wait for all shared directories to become available
smb_dirs=`testparm -st 2> /dev/null | egrep '^\s*path = ' | cut -d= -f2`
ctdb_wait_directories "Samba" $smb_dirs
# start Samba service
service smb start
service winbind start
# wait for the Samba tcp ports to become available
smb_ports=`testparm -stv 2> /dev/null | egrep '\s*smb ports =' | cut -d= -f2`
ctdb_wait_tcp_ports "Samba" $smb_ports
;;
takeip)
# nothing special for Samba
;;
releaseip)
# nothing special for Samba
;;
recovered)
# nothing special for Samba
exit 0
;;
shutdown)
# shutdown Samba when ctdb goes down
service smb stop
service winbind stop
;;
esac
# ignore unknown commands
exit 0