ctdb-scripts: Rename variable CTDB_ETCDIR to CTDB_SYS_ETCDIR
authorMartin Schwenke <martin@meltin.net>
Mon, 17 Aug 2015 04:12:15 +0000 (14:12 +1000)
committerMichael Adam <obnox@samba.org>
Tue, 15 Sep 2015 06:56:21 +0000 (08:56 +0200)
This variable points to /etc/ by default.

This distinguishes it from the different variable from wscript, which
points to /etc/ctdb/.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Jose A. Rivera <jarrpa@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
ctdb/config/events.d/13.per_ip_routing
ctdb/config/functions
ctdb/doc/ctdbd.conf.5.xml
ctdb/tests/eventscripts/50.samba.monitor.110.sh
ctdb/tests/eventscripts/50.samba.monitor.111.sh
ctdb/tests/eventscripts/scripts/local.sh
ctdb/tests/eventscripts/stubs/testparm

index 60c1dd08edd21ad5afb3c695f1f97d649272a66f..56dfc348df431a71cd6b636266efee6f4cbd2fca 100755 (executable)
@@ -95,7 +95,7 @@ ipv4_host_addr_to_net ()
 
 ensure_rt_tables ()
 {
-    rt_tables="$CTDB_ETCDIR/iproute2/rt_tables"
+    rt_tables="$CTDB_SYS_ETCDIR/iproute2/rt_tables"
 
     # This file should always exist.  Even if this didn't exist on the
     # system, adding a route will have created it.  What if we startup
index 85d062cf201618e37a9ea13da96070725621cab0..994c638a5bb656eb7ee9bad391e4996e9fa883e7 100755 (executable)
@@ -15,8 +15,8 @@ if [ -z "$CTDB_SCRIPT_VARDIR" ] ; then
     CTDB_SCRIPT_VARDIR="/usr/local/var/lib/ctdb/state"
 fi
 
-if [ -z "$CTDB_ETCDIR" ] ; then
-    CTDB_ETCDIR="/etc"
+if [ -z "$CTDB_SYS_ETCDIR" ] ; then
+    CTDB_SYS_ETCDIR="/etc"
 fi
 
 #######################################
@@ -39,10 +39,10 @@ _loadconfig() {
        return
     fi
 
-    if [ -f $CTDB_ETCDIR/sysconfig/$1 ]; then
-       . $CTDB_ETCDIR/sysconfig/$1
-    elif [ -f $CTDB_ETCDIR/default/$1 ]; then
-       . $CTDB_ETCDIR/default/$1
+    if [ -f $CTDB_SYS_ETCDIR/sysconfig/$1 ]; then
+       . $CTDB_SYS_ETCDIR/sysconfig/$1
+    elif [ -f $CTDB_SYS_ETCDIR/default/$1 ]; then
+       . $CTDB_SYS_ETCDIR/default/$1
     elif [ -f $CTDB_BASE/sysconfig/$1 ]; then
        . $CTDB_BASE/sysconfig/$1
     fi
@@ -183,10 +183,10 @@ _service ()
       $_nice /sbin/service "$_service_name" "$_op"
   elif [ -x /usr/sbin/service ]; then
       $_nice /usr/sbin/service "$_service_name" "$_op"
-  elif [ -x $CTDB_ETCDIR/init.d/$_service_name ]; then
-      $_nice $CTDB_ETCDIR/init.d/$_service_name "$_op"
-  elif [ -x $CTDB_ETCDIR/rc.d/init.d/$_service_name ]; then
-      $_nice $CTDB_ETCDIR/rc.d/init.d/$_service_name "$_op"
+  elif [ -x $CTDB_SYS_ETCDIR/init.d/$_service_name ]; then
+      $_nice $CTDB_SYS_ETCDIR/init.d/$_service_name "$_op"
+  elif [ -x $CTDB_SYS_ETCDIR/rc.d/init.d/$_service_name ]; then
+      $_nice $CTDB_SYS_ETCDIR/rc.d/init.d/$_service_name "$_op"
   fi
 }
 
index 57835e442be9e71b0e60252283ab735f274a6280..082af0c1503684fa7ff077f88cc225785f774905 100644 (file)
@@ -1498,7 +1498,7 @@ CTDB_SET_MonitorInterval=20
       </varlistentry>
 
       <varlistentry>
-       <term>CTDB_ETCDIR=<parameter>DIRECTORY</parameter></term>
+       <term>CTDB_SYS_ETCDIR=<parameter>DIRECTORY</parameter></term>
        <listitem>
          <para>
            DIRECTORY containing system configuration files.  This is
index 215193356743bc99cbb877803acd911db4453b6d..83a2271f268e6305b92b0a078cb2914bac8d7377 100755 (executable)
@@ -9,7 +9,7 @@ setup_samba
 export FAKE_TESTPARM_FAIL="yes"
 required_result 1 <<EOF
 ERROR: smb.conf cache create failed - testparm failed with:
-Load smb config files from ${CTDB_ETCDIR}/samba/smb.conf
+Load smb config files from ${CTDB_SYS_ETCDIR}/samba/smb.conf
 rlimit_max: increasing rlimit_max (2048) to minimum Windows limit (16384)
 Processing section "[1_existing]"
 Processing section "[2_existing]"
index 53f2f67cfb96fdcdc9e99663a25f066449d71dc2..034e0128b590a25a17ea432601c2e2b0304cf511 100755 (executable)
@@ -12,7 +12,7 @@ simple_test
 export FAKE_TESTPARM_FAIL="yes"
 required_result 1 <<EOF
 WARNING: smb.conf cache update failed - using old cache file
-Load smb config files from ${CTDB_ETCDIR}/samba/smb.conf
+Load smb config files from ${CTDB_SYS_ETCDIR}/samba/smb.conf
 rlimit_max: increasing rlimit_max (2048) to minimum Windows limit (16384)
 Processing section "[1_existing]"
 Processing section "[2_existing]"
index bed602a881347709a2041ef01c122c064eb9b5c3..1edb9a433b04300ae151bcc52480d83066cf8daa 100644 (file)
@@ -33,9 +33,9 @@ touch "${CTDB_LOGGING#file:}" || \
 
 if [ -d "${TEST_SUBDIR}/etc" ] ; then
     cp -a "${TEST_SUBDIR}/etc" "$EVENTSCRIPTS_TESTS_VAR_DIR"
-    export CTDB_ETCDIR="${EVENTSCRIPTS_TESTS_VAR_DIR}/etc"
+    export CTDB_SYS_ETCDIR="${EVENTSCRIPTS_TESTS_VAR_DIR}/etc"
 else
-    die "Unable to setup \$CTDB_ETCDIR"
+    die "Unable to setup \$CTDB_SYS_ETCDIR"
 fi
 
 if [ -d "${TEST_SUBDIR}/etc-ctdb" ] ; then
@@ -881,7 +881,7 @@ rpc_services_up ()
 
 nfs_load_config ()
 {
-    _etc="$CTDB_ETCDIR" # shortcut for readability
+    _etc="$CTDB_SYS_ETCDIR" # shortcut for readability
     for _c in "$_etc/sysconfig/nfs" "$_etc/default/nfs" "$_etc/ctdb/sysconfig/nfs" ; do
        if [ -r "$_c" ] ; then
            . "$_c"
@@ -1166,7 +1166,7 @@ simple_test ()
 
 ##################################################
 CTDB_BASE="$CTDB_BASE"
-CTDB_ETCDIR="$CTDB_ETCDIR"
+CTDB_SYS_ETCDIR="$CTDB_SYS_ETCDIR"
 ctdb client is "$(which ctdb)"
 ip command is "$(which ip)"
 EOF
index 692db45a49d8c9129bc0023d0f454ca508727227..0473bbf4ea23b59aae3e0a221afa4817dfb8f58e 100755 (executable)
@@ -9,7 +9,7 @@ not_implemented ()
 error ()
 {
     cat >&2 <<EOF
-Load smb config files from ${CTDB_ETCDIR}/samba/smb.conf
+Load smb config files from ${CTDB_SYS_ETCDIR}/samba/smb.conf
 rlimit_max: increasing rlimit_max (2048) to minimum Windows limit (16384)
 EOF
 
@@ -68,7 +68,7 @@ if [ -n "$file" ] ; then
     cat "$file"
 else
     # We force our own smb.conf and add the shares.
-    cat "${CTDB_ETCDIR}/samba/smb.conf"
+    cat "${CTDB_SYS_ETCDIR}/samba/smb.conf"
 
     for i in $FAKE_SHARES ; do
        bi=$(basename "$i")