Skip to contentSkip to conversation

more t_client.sh fixes

Openvpn-devel Gert Doering 2 participants 2 messages Feb 3, 2012 – Feb 4, 2012

lore
Share & tools
lore
#0 lore raw

Hi,

last patch for "sudo functionality in t_client.sh" was incomplete, and for some reason I didn't notice on the test system - fell on my feet on the freebsd 7.4 test client, and is now fixed for good :-)

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...

From 7557b960593aa7240cfe7f9e9b5628e3b4ef55c9 Mon Sep 17 00:00:00 2001
From: Gert Doering <[email protected]...>
Date: Fri, 3 Feb 2012 19:18:07 +0200
Subject: [PATCH] Fix RUN_SUDO functionality for t_client.sh

Commit 9c6ee9d1ecd85535c was incomplete - while it will run openvpn with sudo, it will not use sudo for the "kill" commands needed to test whether the background process is still there, and for actually stopping openvpn after the test has finished.

---
 t_client.sh.in |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
t_client.sh.in +4 -4
index a6377db..47839de 100755
@@ -233,14 +233,14 @@ do
     opid=$!
 
     # make sure openvpn client is terminated in case shell exits
-    trap "kill $opid" 0
-    trap "kill $opid ; trap - 0 ; exit 1" 1 2 3 15
+    trap "$RUN_SUDO kill $opid" 0
+    trap "$RUN_SUDO kill $opid ; trap - 0 ; exit 1" 1 2 3 15
 
     echo "wait for connection to establish..."
     sleep 10
 
     # test whether OpenVPN process is still there
-    if kill -0 $opid
+    if $RUN_SUDO kill -0 $opid
     then :
     else
 	echo -e "OpenVPN process has failed to start up, check log ($LOGDIR/$SUF:openvpn.log).  FAIL.\ntail of logfile follows:\n..." >&2
@@ -271,7 +271,7 @@ do
     echo -e "ping tests done.\n"
 
     echo "stopping OpenVPN"
-    kill $opid
+    $RUN_SUDO kill $opid
     wait $!
     rc=$?
     if [ $rc != 0 ] ; then
Signature · 1 line
1.7.3.5
#1 lore raw
Quoted 7 lines · Gert Doering

Hi,

last patch for "sudo functionality in t_client.sh" was incomplete, and for some reason I didn't notice on the test system - fell on my feet on the freebsd 7.4 test client, and is now fixed for good :-)

gert

ACK. Applied to master branch on -testing and -stable.

commit fc3ee19dee6c66e2325a24e864b5328128404e83

Author: Gert Doering <[email protected]...>
Date:   Fri Feb 3 19:18:07 2012 +0200
    Fix RUN_SUDO functionality for t_client.sh

    Signed-off-by: Gert Doering <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

kind regards,

David Sommerseth