[oe-commits] [meta-openembedded] 15/38: net-snmp: check that executable is used before testing for existance

git at git.openembedded.org git at git.openembedded.org
Mon Oct 2 12:40:27 UTC 2017


This is an automated email from the git hooks/post-receive script.

martin_jansa pushed a commit to branch master-next
in repository meta-openembedded.

commit 90bc559c3e6e1e55d1f1f1af90f01f25f6a55f38
Author: Bill Randle <bill.randle at gmail.com>
AuthorDate: Sun Sep 24 10:31:31 2017 -0700

    net-snmp: check that executable is used before testing for existance
    
    The recipe for net-snmp has snmpd and snmptrapd in seperate packages, so one or the other
    or both could be installed. In a common case where only snmpd is installed, the startup
    script will fail to run because the snmptrapd executable does not exist.
    
    This patch simply qualifies the test by first checking to see if the executable is to
    be used.
    
        -Bill
    
    Signed-off-by: Bill Randle <bill.randle at gmail.com>
    Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
---
 meta-networking/recipes-protocols/net-snmp/files/init | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta-networking/recipes-protocols/net-snmp/files/init b/meta-networking/recipes-protocols/net-snmp/files/init
index 2b8fe18..4799546 100755
--- a/meta-networking/recipes-protocols/net-snmp/files/init
+++ b/meta-networking/recipes-protocols/net-snmp/files/init
@@ -3,9 +3,6 @@
 
 . /etc/init.d/functions
 
-test -x /usr/sbin/snmpd || exit 0
-test -x /usr/sbin/snmptrapd || exit 0
-
 # Defaults
 export MIBDIRS=/usr/share/snmp/mibs
 SNMPDRUN=yes
@@ -18,6 +15,9 @@ SPIDFILE=/var/run/snmptrapd.pid
 # Reads config file if exists (will override defaults above)
 [ -r /etc/default/snmpd ] && . /etc/default/snmpd
 
+[ "$SNMPDRUN" = "yes" ] && { test -x /usr/sbin/snmpd || exit 0; }
+[ "$TRAPDRUN" = "yes" ] && { test -x /usr/sbin/snmptrapd || exit 0; }
+
 case "$1" in
   start)
     echo -n "Starting network management services:"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list