]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
make the init scripts more portable about location of system config files
authorAndrew Tridgell <tridge@samba.org>
Sun, 3 Jun 2007 12:07:07 +0000 (22:07 +1000)
committerAndrew Tridgell <tridge@samba.org>
Sun, 3 Jun 2007 12:07:07 +0000 (22:07 +1000)
(This used to be ctdb commit 65f3e2bc722e314b2c51c3bfdc544b408a8a64cf)

ctdb/config/ctdb.init
ctdb/config/events
ctdb/config/events.d/nfs
ctdb/config/events.d/nfslock
ctdb/config/events.d/samba
ctdb/config/functions
ctdb/config/statd-callout

index ad7bd7053129923fb545d644025b34e6dd519e65..35a1d3d34cb50bb299d5239e3f596b6cf40620ce 100755 (executable)
@@ -34,19 +34,15 @@ fi
 # Avoid using root's TMPDIR
 unset TMPDIR
 
+. /etc/ctdb/functions
+loadconfig network
+loadconfig ctdb
+
 # check networking is up (for redhat)
-[ -f /etc/sysconfig/network ] && {
-    . /etc/sysconfig/network
-    [ ${NETWORKING} = "no" ] && exit 0
-}
+[ ${NETWORKING} = "no" ] && exit 0
 
 CTDB_OPTIONS=""
 
-# pull in admin specified config for ctdb
-if [ -f /etc/sysconfig/ctdb ]; then
-   . /etc/sysconfig/ctdb 
-fi
-
 [ -z "$CTDB_RECOVERY_LOCK" ] && {
     echo "You must configure the location of the CTDB_RECOVERY_LOCK"
     exit 1
index 854b2ac77115379ea14fd433652783e9428b301a..58af6a85862e7b4b3c4d0cc89582f14a4181f6bb 100755 (executable)
@@ -2,8 +2,8 @@
 ############################
 # main event script for ctdb
 
-. /etc/sysconfig/ctdb
 . /etc/ctdb/functions
+loadconfig ctdb
 
 cmd="$1"
 shift
index b9b5a403da1f3db87152aac90822b32c1627688b..965199661f3e46c13a3c37159cdf7990c808eece 100644 (file)
@@ -1,8 +1,8 @@
 #!/bin/sh
 # script to manage nfs in a clustered environment
 
-. /etc/sysconfig/nfs
 . /etc/ctdb/functions
+loadconfig nfs
 
 [ -z $CTDB_MANAGES_NFS ] && exit 0
 [ $CTDB_MANAGES_NFS != "yes" ] && exit 0
index da857ce97c9f4b3a9ac9d86cf7d3c339017455c1..72279b27974d7daa8412bfd6bd1bed15a3f6e83e 100644 (file)
@@ -1,8 +1,8 @@
 #!/bin/sh
 # event strict to manage lockd and statd in a cluster environment
 
-. /etc/sysconfig/nfs
 . /etc/ctdb/functions
+loadconfig nfs
 
 [ -z $CTDB_MANAGES_NFS ] && exit 0
 [ $CTDB_MANAGES_NFS != "yes" ] && exit 0
index 5d08213adab65f3c6bdac5acd20d16aa3f090b3e..f17f7eac9867aa26b60f51fdd14b6c04c2a658b7 100644 (file)
@@ -3,8 +3,8 @@
 
 PATH=/bin:/usr/bin:$PATH
 
-. /etc/sysconfig/ctdb
 . /etc/ctdb/functions
+loadconfig ctdb
 
 cmd="$1"
 shift
index 4eb8f4a3d62c139c79d40ee50feabf9716a7192e..f557d62910719bba52741be0848d9c2691f5d498 100644 (file)
@@ -1,5 +1,16 @@
 # utility functions for ctdb event scripts
 
+#######################################
+# pull in a system config file, if any
+loadconfig() {
+    name="$1"
+    if [ -f /etc/sysconfig/$name ]; then
+       . /etc/sysconfig/$name
+    elif [ -f /etc/default/$name ]; then
+       . /etc/default/$name
+    fi
+}
+
 
 ######################################################
 # simulate /sbin/service on platforms that don't have it
index da169575a6590c0d7ccccc99d1e58890d0fdfc2a..3f645ec732ef1f2b348af0614a44223ffc864c3a 100755 (executable)
@@ -5,8 +5,8 @@
 # /etc/sysconfig/nfs:
 #   STATD_HOSTNAME="myhostname -H /etc/ctdb/statd-callout"
 
-
-. /etc/sysconfig/nfs
+. /etc/ctdb/functions
+loadconfig nfs
 
 [ -z "$STATD_SHARED_DIRECTORY" ] && exit 0