]> git.proxmox.com Git - mirror_corosync.git/commitdiff
configure: add --with-initconfigdir option
authorFerenc Wágner <wferi@debian.org>
Thu, 24 Nov 2016 11:06:37 +0000 (12:06 +0100)
committerJan Friesse <jfriesse@redhat.com>
Mon, 30 Oct 2017 12:12:43 +0000 (13:12 +0100)
Default value is /etc/sysconfig and resulting
INITCONFIGDIR is used to reduce duplication in init system
integration code.

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
configure.ac
init/Makefile.am
init/corosync-notifyd.conf.in
init/corosync-notifyd.in
init/corosync-notifyd.service.in
init/corosync-qdevice.in
init/corosync-qnetd.in
init/corosync-qnetd.service.in
init/corosync.conf.in
init/corosync.in

index d6820f52d6a8a905fd29ae4dcde8c543456a17c4..aca792a24d39c8742f4dfef75193a988c723d057 100644 (file)
@@ -365,6 +365,13 @@ AC_ARG_ENABLE([upstart],
        [ enable_upstart="no" ])
 AM_CONDITIONAL(INSTALL_UPSTART, test x$enable_upstart = xyes)
 
+AC_ARG_WITH([initconfigdir],
+       [AS_HELP_STRING([--with-initconfigdir=DIR],
+               [configuration directory @<:@SYSCONFDIR/sysconfig@:>@])],
+       [INITCONFIGDIR="$withval"],
+       [INITCONFIGDIR='${sysconfdir}/sysconfig'])
+AC_SUBST([INITCONFIGDIR])
+
 AC_ARG_WITH([initddir],
        [  --with-initddir=DIR     : path to init script directory. ],
        [ INITDDIR="$withval" ],
@@ -777,6 +784,7 @@ AC_MSG_RESULT([  System tmpfiles.d        = ${TMPFILESDIR}])
 AC_MSG_RESULT([  Log directory            = ${LOGDIR}])
 AC_MSG_RESULT([  Log rotate directory     = ${LOGROTATEDIR}])
 AC_MSG_RESULT([  corosync config dir      = ${COROSYSCONFDIR}])
+AC_MSG_RESULT([  init config directory    = ${INITCONFIGDIR}])
 AC_MSG_RESULT([  Features                 =${PACKAGE_FEATURES}])
 AC_MSG_RESULT([])
 AC_MSG_RESULT([$PACKAGE build info:])
index 379249fc19a598c776b76a9224ee8418ef1ae1d0..3161979ed81fe08d32bf78c89da3d6cafd59c0ae 100644 (file)
@@ -76,6 +76,7 @@ endif
                -e 's#@''SBINDIR@#$(sbindir)#g' \
                -e 's#@''BINDIR@#$(bindir)#g' \
                -e 's#@''SYSCONFDIR@#$(sysconfdir)#g' \
+               -e 's#@''INITCONFIGDIR@#$(INITCONFIGDIR)#g' \
                -e 's#@''INITDDIR@#$(INITDDIR)#g' \
                -e 's#@''INITWRAPPERSDIR@#$(INITWRAPPERSDIR)#g' \
                -e 's#@''LOCALSTATEDIR@#$(localstatedir)#g' \
index b1ac70c83ac9d7f3a8f765a2cf7d4eeb98967409..168a781785aa9638df5dcf71c7cc6ce5d8940492 100644 (file)
@@ -6,14 +6,12 @@ expect fork
 respawn
 
 env prog=corosync-notifyd
-env rpm_sysconf=@SYSCONFDIR@/sysconfig/corosync-notifyd
+env initconf=@INITCONFIGDIR@/corosync-notifyd
 env rpm_lockfile=@LOCALSTATEDIR@/lock/subsys/corosync-notifyd
-env deb_sysconf=@SYSCONFDIR@/default/corosync-notifyd
 env deb_lockfile=@LOCALSTATEDIR@/lock/corosync-notifyd
 
 script
-    [ -f "$rpm_sysconf" ] && . $rpm_sysconf
-    [ -f "$deb_sysconf" ] && . $deb_sysconf
+    [ -f "$initconf" ] && . $initconf
     exec $prog $OPTIONS
 end script
 
@@ -22,16 +20,14 @@ pre-start script
 end script
 
 post-start script
-    [ -f "$rpm_sysconf" ] && . $rpm_sysconf
-    [ -f "$deb_sysconf" ] && . $deb_sysconf
+    [ -f "$initconf" ] && . $initconf
     [ -z "$LOCK_FILE" -a -d @SYSCONFDIR@/sysconfig ] && LOCK_FILE="$rpm_lockfile"
     [ -z "$LOCK_FILE" -a -d @SYSCONFDIR@/default ] && LOCK_FILE="$deb_lockfile"
     touch $LOCK_FILE
 end script
 
 post-stop script
-    [ -f "$rpm_sysconf" ] && . $rpm_sysconf
-    [ -f "$deb_sysconf" ] && . $deb_sysconf
+    [ -f "$initconf" ] && . $initconf
     [ -z "$LOCK_FILE" -a -d @SYSCONFDIR@/sysconfig ] && LOCK_FILE="$rpm_lockfile"
     [ -z "$LOCK_FILE" -a -d @SYSCONFDIR@/default ] && LOCK_FILE="$deb_lockfile"
     rm -f $LOCK_FILE
index 62101421d828254d61b58fa695f0b28676638640..cc944b4e9a61f8e12a74977703d50215d178b1aa 100755 (executable)
@@ -47,16 +47,16 @@ status()
        return $rtrn
 }
 
+[ -f @INITCONFIGDIR@/$prog ] && . @INITCONFIGDIR@/$prog
+
 # rpm based distros
 if [ -d @SYSCONFDIR@/sysconfig ]; then
        [ -f @INITDDIR@/functions ] && . @INITDDIR@/functions
-       [ -f @SYSCONFDIR@/sysconfig/$prog ] && . @SYSCONFDIR@/sysconfig/$prog
        [ -z "$LOCK_FILE" ] && LOCK_FILE="@LOCALSTATEDIR@/lock/subsys/$prog"
 fi
 
 # deb based distros
 if [ -d @SYSCONFDIR@/default ]; then
-       [ -f @SYSCONFDIR@/default/$prog ] && . @SYSCONFDIR@/default/$prog
        [ -z "$LOCK_FILE" ] && LOCK_FILE="@LOCALSTATEDIR@/lock/$prog"
 fi
 
index 689ab8ea21732620eadddb9d27c966e661fbb5c1..f74ca330b1cd9a1da4d272a1dd059b24021d5e25 100644 (file)
@@ -5,7 +5,7 @@ Wants=corosync.service
 After=corosync.service
 
 [Service]
-EnvironmentFile=@SYSCONFDIR@/sysconfig/corosync-notifyd
+EnvironmentFile=-@INITCONFIGDIR@/corosync-notifyd
 ExecStart=@SBINDIR@/corosync-notifyd -f $OPTIONS
 Type=simple
 Restart=on-failure
index 71127e1008679d06e27a46c1dbb32addc2294a29..c69299fcc74351548245961540e962e6016b1aa8 100755 (executable)
@@ -47,16 +47,16 @@ status()
        return $res
 }
 
+[ -f @INITCONFIGDIR@/$prog ] && . @INITCONFIGDIR@/$prog
+
 # rpm based distros
 if [ -d @SYSCONFDIR@/sysconfig ]; then
        [ -f @INITDDIR@/functions ] && . @INITDDIR@/functions
-       [ -f @SYSCONFDIR@/sysconfig/$prog ] && . @SYSCONFDIR@/sysconfig/$prog
        [ -z "$LOCK_FILE" ] && LOCK_FILE="@LOCALSTATEDIR@/lock/subsys/$prog"
 fi
 
 # deb based distros
 if [ -d @SYSCONFDIR@/default ]; then
-       [ -f @SYSCONFDIR@/default/$prog ] && . @SYSCONFDIR@/default/$prog
        [ -z "$LOCK_FILE" ] && LOCK_FILE="@LOCALSTATEDIR@/lock/$prog"
 fi
 
index 15d30eab3f4ccb1e3fecdf2091930622232851dd..beee03a40713dbd0c32a450cd024a804eaa1b975 100755 (executable)
@@ -47,16 +47,16 @@ status()
        return $res
 }
 
+[ -f @INITCONFIGDIR@/$prog ] && . @INITCONFIGDIR@/$prog
+
 # rpm based distros
 if [ -d @SYSCONFDIR@/sysconfig ]; then
        [ -f @INITDDIR@/functions ] && . @INITDDIR@/functions
-       [ -f @SYSCONFDIR@/sysconfig/$prog ] && . @SYSCONFDIR@/sysconfig/$prog
        [ -z "$LOCK_FILE" ] && LOCK_FILE="@LOCALSTATEDIR@/lock/subsys/$prog"
 fi
 
 # deb based distros
 if [ -d @SYSCONFDIR@/default ]; then
-       [ -f @SYSCONFDIR@/default/$prog ] && . @SYSCONFDIR@/default/$prog
        [ -z "$LOCK_FILE" ] && LOCK_FILE="@LOCALSTATEDIR@/lock/$prog"
 fi
 
index c6cf8c995a438dfcc0bd13ad3e789aad7e85c0a9..cae98feba77037c9c476a7d065ab5b6234b83cd8 100644 (file)
@@ -6,7 +6,7 @@ Requires=network-online.target
 After=network-online.target
 
 [Service]
-EnvironmentFile=@SYSCONFDIR@/sysconfig/corosync-qnetd
+EnvironmentFile=-@INITCONFIGDIR@/corosync-qnetd
 ExecStart=@BINDIR@/corosync-qnetd -f $COROSYNC_QNETD_OPTIONS
 Type=simple
 Restart=on-abnormal
index 373565a0e5159aac78e587a20a8461139a81399b..0352d2bbb3030f60e6740dbfe77cbc175785a849 100644 (file)
@@ -5,14 +5,12 @@
 expect fork
 
 env prog=corosync
-env rpm_sysconf=@SYSCONFDIR@/sysconfig/corosync
+env initconf=@INITCONFIGDIR@/corosync
 env rpm_lockfile=@LOCALSTATEDIR@/lock/subsys/corosync
-env deb_sysconf=@SYSCONFDIR@/default/corosync
 env deb_lockfile=@LOCALSTATEDIR@/lock/corosync
 
 script
-    [ -f "$rpm_sysconf" ] && . $rpm_sysconf
-    [ -f "$deb_sysconf" ] && . $deb_sysconf
+    [ -f "$initconf" ] && . $initconf
     exec $prog $COROSYNC_OPTIONS
 end script
 
@@ -25,8 +23,7 @@ end script
 post-start script
 wait_for_ipc()
 {
-    [ -f "$rpm_sysconf" ] && . $rpm_sysconf
-    [ -f "$deb_sysconf" ] && . $deb_sysconf
+    [ -f "$initconf" ] && . $initconf
     try=0
     max_try=$((COROSYNC_INIT_TIMEOUT*2-1))
     [ "$max_try" -le "0" ] && max_try=120
@@ -43,16 +40,14 @@ wait_for_ipc()
 }
     wait_for_ipc || { stop; exit 1; }
 
-    [ -f "$rpm_sysconf" ] && . $rpm_sysconf
-    [ -f "$deb_sysconf" ] && . $deb_sysconf
+    [ -f "$initconf" ] && . $initconf
     [ -z "$LOCK_FILE" -a -d @SYSCONFDIR@/sysconfig ] && LOCK_FILE="$rpm_lockfile"
     [ -z "$LOCK_FILE" -a -d @SYSCONFDIR@/default ] && LOCK_FILE="$deb_lockfile"
     touch $LOCK_FILE
 end script
 
 post-stop script
-    [ -f "$rpm_sysconf" ] && . $rpm_sysconf
-    [ -f "$deb_sysconf" ] && . $deb_sysconf
+    [ -f "$initconf" ] && . $initconf
     [ -z "$LOCK_FILE" -a -d @SYSCONFDIR@/sysconfig ] && LOCK_FILE="$rpm_lockfile"
     [ -z "$LOCK_FILE" -a -d @SYSCONFDIR@/default ] && LOCK_FILE="$deb_lockfile"
     rm -f $LOCK_FILE
index c93f97194a6a748733f955d015e72daeda48c67e..a258c363fd79c3753de176ce056ca1765c1bc7f9 100755 (executable)
@@ -48,16 +48,16 @@ status()
        return $res
 }
 
+[ -f @INITCONFIGDIR@/$prog ] && . @INITCONFIGDIR@/$prog
+
 # rpm based distros
 if [ -d @SYSCONFDIR@/sysconfig ]; then
        [ -f @INITDDIR@/functions ] && . @INITDDIR@/functions
-       [ -f @SYSCONFDIR@/sysconfig/$prog ] && . @SYSCONFDIR@/sysconfig/$prog
        [ -z "$LOCK_FILE" ] && LOCK_FILE="@LOCALSTATEDIR@/lock/subsys/$prog"
 fi
 
 # deb based distros
 if [ -d @SYSCONFDIR@/default ]; then
-       [ -f @SYSCONFDIR@/default/$prog ] && . @SYSCONFDIR@/default/$prog
        [ -z "$LOCK_FILE" ] && LOCK_FILE="@LOCALSTATEDIR@/lock/$prog"
 fi