Hi Dave, when I execute the snmpd command in root account rather than using sudo it works perfectly fine and responses all queries.
[root@volga]# /home/ravi/net-snmp-5.5/agent/snmpd -c /home/ravi/net-snmp-5.5/local/snmpd.conf,/var/net-snmp/snmpd.conf -C -f -Le Cannot find module (IP-MIB): At line 0 in (none) Cannot find module (IF-MIB): At line 0 in (none) NET-SNMP version 5.5 --- --- Similarly when I use sudo command on non-root user (please note without -u option). it works fine as well. [ravi@volga]$ sudo /home/ravi/net-snmp-5.5/agent/snmpd -c /home/ravi/net-snmp-5.5/local/snmpd.conf,/var/net-snmp/snmpd.conf -C -f -Le [sudo] password for ravi: Cannot find module (IP-MIB): At line 0 in (none) Cannot find module (IF-MIB): At line 0 in (none) NET-SNMP version 5.5 ---- ---- Problem comes when I try to switch back to non-root user using -u option. After running snmpd using sudo. In this case snmpd quits with error "initgroups failed: Operation not permitted." [ravi@volga]$ sudo /home/ravi/net-snmp-5.5/agent/snmpd -c /home/ravi/net-snmp-5.5/local/snmpd.conf,/var/net-snmp/snmpd.conf -C -f -Le -u ravi Cannot find module (IP-MIB): At line 0 in (none) Cannot find module (IF-MIB): At line 0 in (none) initgroups failed: Operation not permitted [ravi@volga]$ snmpd fails to start in this case. Moreover I do not want to use SUID bit. As setting SUID bit on executable has its own risks Please suggest. Thanks, Ravi On 3/28/11, Dave Shield <d.t.shi...@liverpool.ac.uk> wrote: > On 28 March 2011 17:22, Ravi Kumar <mynets...@gmail.com> wrote: >> Could any one tell me why the snmpd does not run with sudo as given below. > > There's a problem somewhere. > > > Not a very helpful response, I know - but you haven't > exactly given us much information to work with. > > If you want more meaningful assistance, it would be > useful to let us know stuff like any error messages > that might be generated (perhaps in a log file somewhere, > or by running the agent using "-f -Le" > > Other things to check include: > - is the agent process running (but you can't query it) > or does the agent fail to start? > > - can you start the agent using the same command > from a "full" root account (rather than via sudo) > > > Dave > ------------------------------------------------------------------------------ Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders