mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
cf04ff178c
There is no reconfigure code for these scripts so no need to check for reconfiguration. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 41df1637c1d8a7b2f5a9974408db71b1f74cb2f2)
71 lines
1.0 KiB
Bash
Executable File
71 lines
1.0 KiB
Bash
Executable File
#!/bin/sh
|
|
# ctdb event script for winbind
|
|
|
|
[ -n "$CTDB_BASE" ] || \
|
|
export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")
|
|
|
|
. $CTDB_BASE/functions
|
|
|
|
detect_init_style
|
|
|
|
CTDB_SERVICE_WINBIND=${CTDB_SERVICE_WINBIND:-winbind}
|
|
|
|
service_name="winbind"
|
|
|
|
loadconfig
|
|
|
|
ctdb_setup_service_state_dir
|
|
|
|
service_start ()
|
|
{
|
|
service "$CTDB_SERVICE_WINBIND" stop >/dev/null 2>&1
|
|
killall -0 -q winbindd && {
|
|
sleep 1
|
|
# make absolutely sure winbindd is dead
|
|
killall -q -9 winbindd
|
|
}
|
|
|
|
service "$CTDB_SERVICE_WINBIND" start || \
|
|
die "Failed to start winbind"
|
|
}
|
|
|
|
service_stop ()
|
|
{
|
|
service "$CTDB_SERVICE_WINBIND" stop
|
|
}
|
|
|
|
###########################
|
|
|
|
ctdb_start_stop_service
|
|
|
|
is_ctdb_managed_service || exit 0
|
|
|
|
###########################
|
|
|
|
case "$1" in
|
|
startup)
|
|
ctdb_service_start
|
|
;;
|
|
|
|
shutdown)
|
|
ctdb_service_stop
|
|
;;
|
|
|
|
monitor)
|
|
ctdb_check_command wbinfo -p
|
|
;;
|
|
|
|
takeip|releaseip)
|
|
iface=$2
|
|
ip=$3
|
|
maskbits=$4
|
|
|
|
smbcontrol winbindd ip-dropped $ip >/dev/null 2>/dev/null
|
|
;;
|
|
*)
|
|
ctdb_standard_event_handler "$@"
|
|
;;
|
|
esac
|
|
|
|
exit 0
|