mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
e763874872
(This used to be ctdb commit 65f3e2bc722e314b2c51c3bfdc544b408a8a64cf)
51 lines
902 B
Bash
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
|