ctdb-scripts: Create the directory containing the recovery lock
authorMartin Schwenke <martin@meltin.net>
Tue, 19 May 2015 18:19:09 +0000 (04:19 +1000)
committerAmitay Isaacs <amitay@samba.org>
Wed, 1 Jul 2015 02:18:28 +0000 (04:18 +0200)
This will handle the most obvious cases.  It won't handle the case
where the directory is missing and the recovery lock location is
updated at run-time.  However, this is a good improvement.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/events.d/01.reclock

index ed7afdd78aa89ca4c67cfc3aaf53f049aeef4f22..d3dd612471f3b91b30452d488b05f26ad0b0f944 100755 (executable)
@@ -10,6 +10,11 @@ loadconfig
 case "$1" in
     init)
        ctdb_counter_init
+
+       if [ -n "$CTDB_RECOVERY_LOCK" ] ; then
+           d=$(dirname "$CTDB_RECOVERY_LOCK")
+           mkdir -vp "$d"
+       fi
        ;;
 
     monitor)