diff options
author | Martin Schwenke <martin@meltin.net> | 2010-12-15 10:49:48 +1100 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2011-08-09 16:35:07 +1000 |
commit | ee38b9a159435616b461b4b734295a1d3ea485ac (patch) | |
tree | a86e96311e035ae97185ba917a9bbb76bbf6ae93 | |
parent | ec33c0428348dcb827490b9e5615a51fb1d5ea52 (diff) | |
download | samba-ee38b9a159435616b461b4b734295a1d3ea485ac.tar.gz samba-ee38b9a159435616b461b4b734295a1d3ea485ac.tar.xz samba-ee38b9a159435616b461b4b734295a1d3ea485ac.zip |
Eventscript functions: new function ctdb_setup_service_state_dir().
To be used by eventscripts to create a per-service directory for their
own state data. $service_state_dir is set to point to the new
directory.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit a273554791c2a5281aee28f8e2be0c514e14c91e)
-rwxr-xr-x | ctdb/config/functions | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ctdb/config/functions b/ctdb/config/functions index 577471af0a..32f11f0690 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -562,6 +562,15 @@ ctdb_check_counter_equal () { ctdb_status_dir="$CTDB_VARDIR/status" ctdb_fail_dir="$CTDB_VARDIR/failcount" +ctdb_setup_service_state_dir () +{ + service_state_dir="$CTDB_VARDIR/state/${1:-${service_name}}" + mkdir -p "$service_state_dir" || { + echo "Error creating state dir \"$service_state_dir\"" + exit 1 + } +} + ######################################################## # Managed status history, for auto-start/stop |