On 10 February 2011 17:12, Wes Hardaker <[email protected]> wrote:
> DS> Wes - is it worth trying to catch SIGQUIT,
> DS> and handling this in a similar way to SIGINT.
>
> I don't think you can do that.
The following patch seems to do the trick.
With this, running
snmpd -f -Le -Dread_config
Ctrl-\
gives the same output as using Ctrl-C to kill the agent.
(using read_config as a convenient way of tracking
shutdown processing) Without the patch, I get
Quit (core dumped)
Dave
Index: agent/snmpd.c
===================================================================
--- agent/snmpd.c (revision 19896)
+++ agent/snmpd.c (working copy)
@@ -464,6 +464,10 @@
DEBUGMSGTL(("signal", "registering SIGTERM signal handler\n"));
signal(SIGTERM, SnmpdShutDown);
#endif
+#ifdef SIGQUIT
+ DEBUGMSGTL(("signal", "registering SIGQUIT signal handler\n"));
+ signal(SIGQUIT, SnmpdShutDown);
+#endif
#ifdef SIGINT
DEBUGMSGTL(("signal", "registering SIGINT signal handler\n"));
signal(SIGINT, SnmpdShutDown);
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders