From f5d9f7226c0b4f291f2ee5e48f4424d2cfa576c2 Mon Sep 17 00:00:00 2001 From: Kristofer Hallin Date: Sat, 7 May 2022 12:37:19 +0000 Subject: [PATCH] Don't rely on the pid-file to see if snmpd is running or not. --- test/lib.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/lib.sh b/test/lib.sh index ff70ad86..dae8d887 100755 --- a/test/lib.sh +++ b/test/lib.sh @@ -213,7 +213,8 @@ fi if $SNMPCHECK; then if [ "${WITH_NETSNMP}" == "yes" ]; then - if [ ! -f /run/snmpd.pid ]; then + pgrep snmpd > /dev/null + if [ $? != 0 ]; then echo -e "\e[31m\nenable-netsnmp set but snmpd not running, start with:" echo "systemctl start snmpd" echo ""