]> git.proxmox.com Git - mirror_corosync.git/commitdiff
build: make path to bash configurable at build time
authorFabio M. Di Nitto <fdinitto@redhat.com>
Tue, 28 Aug 2012 07:04:21 +0000 (09:04 +0200)
committerFabio M. Di Nitto <fdinitto@redhat.com>
Tue, 28 Aug 2012 13:14:49 +0000 (15:14 +0200)
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
13 files changed:
configure.ac
cts/agents/Makefile.am
cts/agents/cmap-dispatch-deadlock.sh [deleted file]
cts/agents/cmap-dispatch-deadlock.sh.in [new file with mode: 0644]
cts/agents/shm_leak_audit.sh [deleted file]
cts/agents/shm_leak_audit.sh.in [new file with mode: 0644]
init/Makefile.am
init/corosync-notifyd.in
init/corosync.in
test/Makefile.am
test/ploadstart.sh
tools/Makefile.am
tools/corosync-xmlproc.sh

index 5b9971f0e55289ba4ff7482d75f4b753b3e59cb9..a432dbe6e29ebcfb8357819847a0b2e12ff2ff9a 100644 (file)
@@ -77,6 +77,7 @@ AC_CHECK_PROGS([DOT], [dot])
 AC_CHECK_PROGS([DOXYGEN], [doxygen])
 AC_CHECK_PROGS([AWK], [awk])
 AC_CHECK_PROGS([SED], [sed])
+AC_PATH_PROG([BASHPATH], [bash])
 
 # Checks for compiler characteristics.
 AC_PROG_GCC_TRADITIONAL
@@ -601,6 +602,7 @@ CPPFLAGS="$ENV_CPPFLAGS $ANSI_CPPFLAGS $OS_CPPFLAGS"
 LDFLAGS="$ENV_LDFLAGS $COVERAGE_LDFLAGS $OS_LDFLAGS"
 
 # substitute what we need:
+AC_SUBST([BASHPATH])
 AC_SUBST([INITDDIR])
 AC_SUBST([SYSTEMDDIR])
 INITWRAPPERSDIR=$(eval echo ${INITWRAPPERSDIR})
index 0edc4788623bf47efb3e5fba9f3eb05ba3ea6261..66038900f9261b0c721a53577a1d93e801755f13 100644 (file)
@@ -31,6 +31,9 @@
 
 MAINTAINERCLEANFILES           = Makefile.in
 
+EXTRA_DIST                     = cmap-dispatch-deadlock.sh.in \
+                                 shm_leak_audit.sh.in
+
 TEST_AGENTS                    = cpg_test_agent \
                                  sam_test_agent \
                                  votequorum_test_agent
@@ -51,6 +54,14 @@ noinst_PROGRAMS                      = $(TEST_AGENTS)
 noinst_SCRIPTS                 = $(SHELL_TESTS)
 endif
 
+cmap-dispatch-deadlock.sh: cmap-dispatch-deadlock.sh.in
+       sed -e 's#@''BASHPATH@#${BASHPATH}#g' $< > $@
+       chmod 755 $@
+
+shm_leak_audit.sh: shm_leak_audit.sh.in
+       sed -e 's#@''BASHPATH@#${BASHPATH}#g' $< > $@
+       chmod 755 $@
+
 AM_CPPFLAGS                    = -I$(top_builddir)/include \
                                  -I$(top_srcdir)/include \
                                  -I$(top_builddir)/include/corosync
@@ -77,6 +88,9 @@ votequorum_test_agent_LDADD   = $(LIBQB_LIBS) \
                                  $(top_builddir)/lib/libvotequorum.la \
                                  $(top_builddir)/common_lib/libcorosync_common.la
 
+clean-local:
+       rm -f shm_leak_audit.sh cmap-dispatch-deadlock.sh
+
 lint:
        -splint $(LINT_FLAGS) $(CFLAGS) *.c
 
diff --git a/cts/agents/cmap-dispatch-deadlock.sh b/cts/agents/cmap-dispatch-deadlock.sh
deleted file mode 100644 (file)
index 1ccc5bd..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/bash
-
-export TIMEOUT=600
-export PID=$$
-up_to=200
-
-rec_plist() {
-    if [ "$2" == "" ];then
-       pl="`ps ax -o pid= -o ppid= -o comm=`"
-    else
-       pl=$2
-    fi
-
-    list=`echo "$pl" | egrep "^ *[0-9]+ +$1" | awk '{ print $1 }'`
-    tmplist=$list
-    for i in $tmplist;do
-       [ "$i" != "$1" ] && [ "$i" != "$$" ] && list="$list "`rec_plist $i "$pl"`
-    done
-
-    echo $list
-}
-
-rec_pkill() {
-    kill -9 `rec_plist "$1"` 2> /dev/null
-}
-
-exit_timeout() {
-    echo "ERR: Timeout. Test failed $PID"
-    rec_pkill "$$"
-    exit 1
-}
-
-corosync-cmapctl -s test.abd "str" "test" || exit 2
-
-trap exit_timeout SIGUSR1
-(sleep $TIMEOUT ; kill -SIGUSR1 $PID) &
-
-wait_list=""
-
-for e in {1..40};do
-    (for a in `seq 1 $up_to`;do corosync-cmapctl -s test.abd "str" $a ; done) &
-    wait_list="$wait_list $!"
-done
-
-notify_list=""
-
-for i in {1..2};do
-    sleep 600000 | corosync-cmapctl -t test > /dev/null &
-    notify_list="$notify_list $!"
-done
-
-wait $wait_list
-
-rec_pkill "$$"
-
-echo "OK"
-exit 0
diff --git a/cts/agents/cmap-dispatch-deadlock.sh.in b/cts/agents/cmap-dispatch-deadlock.sh.in
new file mode 100644 (file)
index 0000000..e5e4567
--- /dev/null
@@ -0,0 +1,57 @@
+#!@BASHPATH@
+
+export TIMEOUT=600
+export PID=$$
+up_to=200
+
+rec_plist() {
+    if [ "$2" == "" ];then
+       pl="`ps ax -o pid= -o ppid= -o comm=`"
+    else
+       pl=$2
+    fi
+
+    list=`echo "$pl" | egrep "^ *[0-9]+ +$1" | awk '{ print $1 }'`
+    tmplist=$list
+    for i in $tmplist;do
+       [ "$i" != "$1" ] && [ "$i" != "$$" ] && list="$list "`rec_plist $i "$pl"`
+    done
+
+    echo $list
+}
+
+rec_pkill() {
+    kill -9 `rec_plist "$1"` 2> /dev/null
+}
+
+exit_timeout() {
+    echo "ERR: Timeout. Test failed $PID"
+    rec_pkill "$$"
+    exit 1
+}
+
+corosync-cmapctl -s test.abd "str" "test" || exit 2
+
+trap exit_timeout SIGUSR1
+(sleep $TIMEOUT ; kill -SIGUSR1 $PID) &
+
+wait_list=""
+
+for e in {1..40};do
+    (for a in `seq 1 $up_to`;do corosync-cmapctl -s test.abd "str" $a ; done) &
+    wait_list="$wait_list $!"
+done
+
+notify_list=""
+
+for i in {1..2};do
+    sleep 600000 | corosync-cmapctl -t test > /dev/null &
+    notify_list="$notify_list $!"
+done
+
+wait $wait_list
+
+rec_pkill "$$"
+
+echo "OK"
+exit 0
diff --git a/cts/agents/shm_leak_audit.sh b/cts/agents/shm_leak_audit.sh
deleted file mode 100755 (executable)
index ad6dc84..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/bash
-
-
-service corosync status >/dev/null
-CS_STATUS=$?
-
-if [ $CS_STATUS -eq 0 ]
-then
-    # corosync running
-    active=$(corosync-cmapctl runtime.connections.active | cut -d= -f2)
-    if [ $active -lt 2 ]
-    then
-        FILES=$(ls /dev/shm/qb-*)
-        for f in $FILES
-        do
-            if [[ "$f" =~ "blackbox" ]]
-            then
-                true
-            else
-                echo $f
-            fi
-        done
-    else
-        pids=$(corosync-cmapctl runtime.connections. | grep client_pid | cut -d= -f2)
-
-        FILES=$(ls /dev/shm/qb-*)
-        for f in $FILES
-        do
-            found=0
-            for p in $pids
-            do
-                if [[ "$f" =~ "$p" ]]
-                then
-                    found=1
-                elif [[ "$f" =~ "blackbox" ]]
-                then
-                    found=1
-                fi
-            done
-            if [ $found -eq 0 ]
-            then
-                echo $f
-            fi
-        done
-    fi
-else
-    FILES=$(ls /dev/shm/qb-*)
-    for f in $FILES
-    do
-        echo $f
-    done
-fi
-
-exit 0
-
diff --git a/cts/agents/shm_leak_audit.sh.in b/cts/agents/shm_leak_audit.sh.in
new file mode 100644 (file)
index 0000000..0272705
--- /dev/null
@@ -0,0 +1,55 @@
+#!@BASHPATH@
+
+
+service corosync status >/dev/null
+CS_STATUS=$?
+
+if [ $CS_STATUS -eq 0 ]
+then
+    # corosync running
+    active=$(corosync-cmapctl runtime.connections.active | cut -d= -f2)
+    if [ $active -lt 2 ]
+    then
+        FILES=$(ls /dev/shm/qb-*)
+        for f in $FILES
+        do
+            if [[ "$f" =~ "blackbox" ]]
+            then
+                true
+            else
+                echo $f
+            fi
+        done
+    else
+        pids=$(corosync-cmapctl runtime.connections. | grep client_pid | cut -d= -f2)
+
+        FILES=$(ls /dev/shm/qb-*)
+        for f in $FILES
+        do
+            found=0
+            for p in $pids
+            do
+                if [[ "$f" =~ "$p" ]]
+                then
+                    found=1
+                elif [[ "$f" =~ "blackbox" ]]
+                then
+                    found=1
+                fi
+            done
+            if [ $found -eq 0 ]
+            then
+                echo $f
+            fi
+        done
+    fi
+else
+    FILES=$(ls /dev/shm/qb-*)
+    for f in $FILES
+    do
+        echo $f
+    done
+fi
+
+exit 0
+
index 21d1e22bde9812f90de24fd728702ae5f7a41e3c..804ad7cf5e79c930831218a2127ed9710d181815 100644 (file)
@@ -53,6 +53,7 @@ initscript_SCRIPTS  = corosync corosync-notifyd
                -e 's#@''INITDDIR@#$(INITDDIR)#g' \
                -e 's#@''INITWRAPPERSDIR@#$(INITWRAPPERSDIR)#g' \
                -e 's#@''LOCALSTATEDIR@#$(localstatedir)#g' \
+               -e 's#@''BASHPATH@#${BASHPATH}#g' \
            > $@-t
        mv $@-t $@
 
index 84de9aeaef4be7dc79b2058b146f1fe79f7c0038..3711821658a601cdca9babc739a14517d56444ab 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!@BASHPATH@
 
 # Authors:
 #  Angus Salkeld <asalkeld@redhat.com>
index a9840bd9c6f6b45a44413a8ba91b80e87ae1409a..cfd51f2bbf3febafd61b825bcf635a253df26d1b 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!@BASHPATH@
 
 # Authors:
 #  Andrew Beekhof <abeekhof@redhat.com>
index a7c3c63edfebaa1df89e33246ff45d4f5faa6add..777a1f0ed7d8227826050416ecf19935e719c3ee 100644 (file)
@@ -64,7 +64,7 @@ cpgbenchzc_LDADD      = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
 testsam_LDADD          = $(LIBQB_LIBS) $(top_builddir)/lib/libsam.la
 
 ploadstart: ploadstart.sh
-       cp $^ $@
+       sed -e 's#@''BASHPATH@#${BASHPATH}#g' $< > $@
        chmod 755 $@
 
 LINT_FILES1:=$(filter-out sa_error.c, $(wildcard *.c))
index 7bd7c9d9117914b3a09f528276afd0dd6c4df7d4..bea065b8cc1ea4a0e93bd81d77c624b815dc3d33 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!@BASHPATH@
 
 set -e
 
index 6abc972bb772ec445466f40a99d4293605474df5..e99451672d600ec6464e071f26dc77fa3cb015e2 100644 (file)
@@ -47,7 +47,9 @@ EXTRA_DIST            = $(bin_SCRIPTS) corosync-xmlproc.sh \
                           corosync-blackbox.sh
 
 corosync-xmlproc: corosync-xmlproc.sh
-       sed -e 's#@''DATADIR@#${datadir}#g' $< > $@
+       sed -e 's#@''DATADIR@#${datadir}#g' \
+           -e 's#@''BASHPATH@#${BASHPATH}#g' \
+           $< > $@
 
 corosync-blackbox: corosync-blackbox.sh
        sed -e 's#@''LOCALSTATEDIR@#${localstatedir}#g' $< > $@
index d6b24aa66c3bdb1a23430240ae3be20bf9174a9e..c098958f0e5279f62b46a44a425fa5620b8a3154 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!@BASHPATH@
 
 # Copyright (c) 2011 Red Hat, Inc.
 #