hp-snmp-agents keeps listening socket open when receiving HUP signal from logrotate
This document (7010686) is provided subject to the disclaimer at the end of this document.
Environment
Situation
hp-snmp-agents-9.1.0.57-52.sles11
On SLES11SP1 logrotate send a kill -HUP to the net-snmpd daemon. If the HP support pack is installed, this will restart hp-snmp-agents but the Cmax module will keep its listening port open.
The following error message can be found in /var/log/net-snmpd.log:
Checking /proc/<pid-of-snmpd>/fd the following can be seen:
lrwx------ 1 root root 64 May 24 21:13 0 -> /dev/null
lrwx------ 1 root root 64 May 24 21:13 1 -> /dev/null
lrwx------ 1 root root 64 May 24 21:13 10 -> socket:[475794478]
lrwx------ 1 root root 64 May 24 21:26 12 -> socket:[476064548]
lrwx------ 1 root root 64 May 24 21:13 2 -> /dev/null
l-wx------ 1 root root 64 May 24 21:13 3 -> /var/log/net-snmpd.log
lr-x------ 1 root root 64 May 24 21:13 4 -> pipe:[475794401]
l-wx------ 1 root root 64 May 24 21:13 5 -> pipe:[475794401]
lr-x------ 1 root root 64 May 24 21:13 6 -> /etc/sensors.conf
For each received HUP signal, a new socket will get opened.
Resolution
Workaround for logrotate:
The HUP signal is send from /etc/logrotate.d/net-snmp. At the end of the file there is an entry:
Please change this to:
try-restart sends a TERM signal which reliably closes the port and socket.
Cause
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:7010686
- Creation Date: 27-Aug-2012
- Modified Date:28-Sep-2022
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com