Dear All,

I am using Net-SNMP version 5.3.1 and have encountered a problem for a daemon configured to use pass-through persist (pass_persist token in the configuration file).

Normally, the daemon re-reads it's configuration files when sent a HUP signal.  However when using pass_persist, the daemon becomes blocked after receiving the HUP signal because the daemon calls the waitpid function for the PID of the pass-through executable (line 771 of agent/mibgroup/ucd-snmp/pass_persist.c in the close_persist_pipe function).  In the absence of the WNOHANG option, this function blocks until the child process has changed state.  However, the child process is never informed that it should terminate.  In my pass-through executable, the process continually loops until standard input is received (but will terminate when a TERM signal is received).

One way to solve this is for Net-SNMP to kill the child process by sending a signal which the child process can handle and cleanly shutdown (using the kill function).  This should be done before the waitpid call which will then return immediately since the child has terminated.

Note that in order to reproduce this problem, a request needs to be made to the section of the MIB that is handled by the pass-through executable before sending the HUP.  If this request is not made, then the pass-through executable will not have been started and the waitpid will never be called.

Please let me know if I have configured the daemon incorrectly or if my implementation is incorrect.

Regards,
Anthony


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to