[SERVER-8998] SNMP: silent server crash when permission denied for AgentXSocket Created: 15/Mar/13 Updated: 11/Jul/16 Resolved: 02/Dec/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Diagnostics, Stability |
| Affects Version/s: | 2.2.3 |
| Fix Version/s: | 2.5.5 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | John Morales | Assignee: | Andy Schwerin |
| Resolution: | Done | Votes: | 0 |
| Labels: | snmp, subscriber | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Subscriber / Enterprise edition, EC2 amzn Linux |
||
| Operating System: | ALL | |||||||||||||||||||||||||||||||||||||
| Steps To Reproduce: | E.g. /etc/snmp/mongod.conf:
Now attempt to start mongod as any non-root user. Example command used: $ ./bin/mongod -vvvvvvvvvvvv --snmp-master --port 3002 --fork --dbpath data --logpath logs/mongod.master.log --nojournal --smallfiles --nohttpinterface Corresponding mongod log (complete):
|
|||||||||||||||||||||||||||||||||||||
| Participants: |
| Description |
|
If AgentX (sub-agent) is configured in /etc/snmp/mongod.conf, but the user the server's running as doesn't have access to the AgentXSocket definition, the server crashes (w/o stack trace or log message) and is left in "needs repair" state. Note: this can be the case because either: |
| Comments |
| Comment by Githook User [ 02/Dec/13 ] |
|
Author: {u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}Message: |
| Comment by Githook User [ 02/Dec/13 ] |
|
Author: {u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}Message: This prevents static destructors from running if the program exits via ::exit() |
| Comment by Eric Milkie [ 01/Nov/13 ] |
|
Indeed, I found the call to exit(0) in the agentx code when it fails to open the socket. |
| Comment by Matt Dannenberg [ 31/Oct/13 ] |
|
It seems like when SNMPAgent calls init_master_agent() (a function from snmp.h) that function then calls exit() rather than _exit(). I looked around online for a while for a solution, but didn't find anything helpful. In their release notes ( http://www.net-snmp.org/docs/NEWS.html ) for version 4.1.2 they "fix init_master_agent calling exit" which I guess that means fixed it to call exit().... |