1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/ctdb/config/events.d/06.nfs
Martin Schwenke e70e77383c ctdb-scripts: Drop configuration variable CTDB_SERVICE_AUTOSTARTSTOP
This has bit-rotted, at least for NFS.  It can be fixed but it is
better to remove it because it adds a lot of unnecessary complexity.

Variable event_name becomes unused so remove it.  Also remove
associated tests.

To continue to manage/unmanage services while CTDB is running:

* Start service by hand and then flag it as managed

* Mark service as unmanaged and shut it down by hand

In some cases CTDB does something fancy - e.g. start Samba under
"nice", so care is needed.  One technique is to disable the
eventscript, mark as managed, run the startup event by hand and then
re-enable the eventscript.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-01-16 11:57:07 +01:00

41 lines
732 B
Bash
Executable File

#!/bin/sh
# script to manage nfs in a clustered environment
[ -n "$CTDB_BASE" ] || \
CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
. "${CTDB_BASE}/functions"
# service_name is used by various functions
# shellcheck disable=SC2034
service_name="nfs"
loadconfig
service_state_dir=$(ctdb_setup_service_state_dir) || exit $?
######################################################################
nfs_callout_pre ()
{
_event="$1"
shift
nfs_callout "${_event}-pre" "$@"
}
######################################################################
nfs_callout_init "$service_state_dir"
is_ctdb_managed_service || exit 0
case "$1" in
takeip)
nfs_callout_pre "$@"
;;
releaseip)
nfs_callout_pre "$@"
;;
esac