From 4c3bbcc0ed691db4fa50a8f235765408b79aa1e3 Mon Sep 17 00:00:00 2001 From: Kristofer Hallin Date: Sun, 1 May 2022 12:34:34 -0700 Subject: [PATCH] Fix for snmpd in Alpine, snmpd crashes with the default configuration. --- test/test_snmp_table.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/test_snmp_table.sh b/test/test_snmp_table.sh index b26cd208..6f2a200c 100755 --- a/test/test_snmp_table.sh +++ b/test/test_snmp_table.sh @@ -51,7 +51,13 @@ function testinit(){ sudo killall snmpd new "Starting $snmpd --rwcommunity=public --master=agentx --agentXSocket=unix:/tmp/clixon_snmp.sock udp:127.0.0.1:1161" - $snmpd --rwcommunity=public --master=agentx --agentXSocket=unix:$SOCK udp:127.0.0.1:1161 + + # Dirty workaround for snmpd in Alpine + if [ -f /.dockerenv ]; then + $snmpd -C --rwcommunity=public --master=agentx --agentXSocket=unix:$SOCK udp:127.0.0.1:1161 + else + $snmpd --rwcommunity=public --master=agentx --agentXSocket=unix:$SOCK udp:127.0.0.1:1161 + fi pgrep snmpd if [ $? != 0 ]; then @@ -78,7 +84,7 @@ function testinit(){ start_snmp $cfg & # Wait for things to settle - sleep 10 + sleep 3 } function testexit(){