mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
ctdb-scripts: Add eventscript 06.nfs
This generates takeip-pre and releaseip-pre call-out events. One use is to put NFS into grace before an IP is assigned to an interface. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
6096233919
commit
48d1fd8299
39
ctdb/config/events.d/06.nfs
Executable file
39
ctdb/config/events.d/06.nfs
Executable file
@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
# script to manage nfs in a clustered environment
|
||||
|
||||
[ -n "$CTDB_BASE" ] || \
|
||||
export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")
|
||||
|
||||
. $CTDB_BASE/functions
|
||||
|
||||
service_name="nfs"
|
||||
loadconfig
|
||||
ctdb_setup_service_state_dir
|
||||
|
||||
######################################################################
|
||||
|
||||
nfs_callout_pre ()
|
||||
{
|
||||
_event="$1"
|
||||
shift
|
||||
|
||||
nfs_callout "${_event}-pre" "$@"
|
||||
}
|
||||
|
||||
######################################################################
|
||||
|
||||
nfs_callout_init
|
||||
|
||||
ctdb_start_stop_service
|
||||
|
||||
is_ctdb_managed_service || exit 0
|
||||
|
||||
case "$1" in
|
||||
takeip)
|
||||
nfs_callout_pre "$@"
|
||||
;;
|
||||
|
||||
releaseip)
|
||||
nfs_callout_pre "$@"
|
||||
;;
|
||||
esac
|
@ -242,7 +242,7 @@ case "$1" in
|
||||
register)
|
||||
nfs_register
|
||||
;;
|
||||
monitor-pre|releaseip|takeip)
|
||||
monitor-pre|releaseip|takeip|releaseip-pre|takeip-pre)
|
||||
# Not required/implemented
|
||||
:
|
||||
;;
|
||||
|
@ -335,7 +335,7 @@ case "$action" in
|
||||
takeip) nfs_takeip "$@" ;;
|
||||
monitor-list-shares) nfs_monitor_list_shares ;;
|
||||
register) nfs_register ;;
|
||||
monitor-pre|monitor-post)
|
||||
monitor-pre|monitor-post|releaseip-pre|takeip-pre)
|
||||
# Not required/implemented
|
||||
:
|
||||
;;
|
||||
|
@ -171,6 +171,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_sysconfdir}/ctdb/events.d/00.ctdb
|
||||
%{_sysconfdir}/ctdb/events.d/01.reclock
|
||||
%{_sysconfdir}/ctdb/events.d/05.system
|
||||
%{_sysconfdir}/ctdb/events.d/06.nfs
|
||||
%{_sysconfdir}/ctdb/events.d/10.interface
|
||||
%{_sysconfdir}/ctdb/events.d/10.external
|
||||
%{_sysconfdir}/ctdb/events.d/13.per_ip_routing
|
||||
|
Loading…
Reference in New Issue
Block a user