This hack is shameful but the eventscript really needs to be split to
avoid this type of rubbish - 1 service per eventscript!
There are a few ways of hacking the conditions and this doesn't seem
much worse than any of the others...
This works... but on autostart will still restart the service that
isn't being autostarted. That's a separate bug.
Signed-off-by: Martin Schwenke <martin@meltin.net>
stop_samba() {
# shutdown Samba when ctdb goes down
- [ "$CTDB_MANAGES_SAMBA" = "yes" ] && {
+ [ "$CTDB_AUTOSTOPPING" != "winbind" -a "$CTDB_MANAGES_SAMBA" = "yes" -o "$CTDB_AUTOSTOPPING" = "samba" ] && {
service "$CTDB_SERVICE_SMB" stop
service "$CTDB_SERVICE_NMB" stop
}
# stop the winbind service
check_ctdb_manages_winbind
- [ "$CTDB_MANAGES_WINBIND" = "yes" ] && {
+ [ "$CTDB_AUTOSTOPPING" != "samba" -a "$CTDB_MANAGES_WINBIND" = "yes" -o "$CTDB_AUTOSTOPPING" = "winbind" ] && {
service "$CTDB_SERVICE_WINBIND" stop
}
else
if [ -e "$_active" ] ; then
echo "Stopping service $_service_name"
+ CTDB_AUTOSTOPPING="$_service_name"
ctdb_service_stop || exit $?
rm -f "$_active"
exit 0