SNMP daemon still running after snmpd -h command

Josef Ridky <[email protected]>
Newsgroups gmane.network.net-snmp.devel
Message-ID <[email protected]>
Hi folks,

I have discovered following issue.

When I run in terminal:
# snmpd -h

I get proper usage information, but snmpd process still exists.
I prepared simple patch with solution based on code from 5.7 version of net-snmp (in attachment).

Regards

Josef Ridky
Associate Software Engineer
Core Services Team
Red Hat Czech, s.r.o.

_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
0001-Exit-snmpd-after-calling-snmpd-h.patch (text/x-patch, 553 B)
From ee487531b8e6efaff661cbc197c4b7cadac6ea03 Mon Sep 17 00:00:00 2001
From: Josef Ridky <[email protected]>
Date: Thu, 4 Oct 2018 10:22:57 +0200
Subject: [PATCH] Exit snmpd after calling snmpd -h

---
 agent/snmpd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/agent/snmpd.c b/agent/snmpd.c
index a0f2d6552..e2169a793 100644
--- a/agent/snmpd.c
+++ b/agent/snmpd.c
@@ -289,6 +289,7 @@ usage(char *prog)
            "  -S d|i|0-7\t\tuse -Ls <facility> instead\n"
            "\n"
            );
+           exit(1);
 }
 
 static void
-- 
2.14.4
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.