LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   SNMPd will not start - segmentation error (https://www.linuxquestions.org/questions/linux-software-2/snmpd-will-not-start-segmentation-error-903717/)

medik 09-18-2011 04:00 PM

SNMPd will not start - segmentation error
 
Hi Linux users! I am using Slackware 13.1 and I need a little help regarding to my problem.

In my course to install MRTG I needed snmp running. Then I thought "Ow, lets check the /etc/rc.d/ directory for clues!", I found a script called "rc.snmpd" so I wrote:

# rc.snmpd start

And got the output:

Starting snmpd: /etc/rc.d/rc.snmpd: line 8: 12807 Segmentation fault /usr/sbin/snmpd $OPTIONS -c /etc/snmp/snmpd.conf
/usr/sbin/snmpd -A -p /var/run/snmpd -a -c /etc/snmp/snmpd.conf

The first thought was maybe it was a problem with the script, so I "vim:ed" the script and found nothing remarkable. On line 8, it says:

start() {
if [ -x /usr/sbin/snmpd -a -f /etc/snmp/snmpd.conf ]; then
echo -n "Starting snmpd: "
/usr/sbin/snmpd $OPTIONS -c /etc/snmp/snmpd.conf
echo " /usr/sbin/snmpd $OPTIONS -c /etc/snmp/snmpd.conf"
fi
}

Which does not say too much about the main problem.. Then I troubleshooted by writing the script by hand and found a clue. Hey, maybe it was not the script. It is in the program! So I searched on google and found nothing remarkable on "Segmentation fault + snmpd". Then I found somewhere it may be a error on the version of snmpd installed (5.5).

So I downloaded a new version (5.7) of snmpd. Compiled and installed, and got the same error message when I trying to start the daemon by writing /etc/rc.d/. The difference though, is when I writing snmpd alone. Then I got a new error message:

snmpd: error while loading shared libraries: libnetsnmpagent.so.30: cannot open shared object file: No such file or directory

What now?

kforbus 09-18-2011 10:21 PM

Did you already make the snmpd.conf file in the /etc/snmp directory? If I recall correctly, it isn't there by default, but there is a sample file you can copy or rename to snmpd.conf. Once you do that, the stock snmp daemon that installs with Slackware should work fine.

medik 09-19-2011 12:22 AM

# ls -l /etc/snmp/
total 20
-rw-r--r-- 1 root root 18579 Jan 18 2010 snmpd.conf

It is probably one there by default. Here is an output of the content in the snmpd.conf file http://pastebay.com/138746

kforbus 09-19-2011 11:38 PM

Yeah, it probably is there by default. I am probably just remembering incorrectly. Not the first time that's happened and probably won't be the last. :)
Nothing jumps out at me as being a problem with that config file.

Since you mentioned that you are still getting the same error you got before and now you have a missing library with 5.7, you may want to roll back your 5.7 upgrade. Probably also wouldn't hurt to re-install the net-snmp package from your Slackware installation source as it should have all the libraries needed for that version.

Good luck and hope to hear back on your progress with this.

medik 09-20-2011 02:48 PM

Now I changed mirror to be on the safe side.

#slackpkg remove net-snmp
#slackpkg install net-snmp

Ok, so far so good! When I try to start snmp with
#/etc/rc.d/rc.snmpd start

I get still the errormessage
# /etc/rc.d/rc.snmpd start
Starting snmpd: /etc/rc.d/rc.snmpd: line 8: 24575 Segmentation fault /usr/sbin/snmpd $OPTIONS -c /etc/snmp/snmpd.conf
/usr/sbin/snmpd -A -p /var/run/snmpd -a -c /etc/snmp/snmpd.conf

But when I trying to start snmp using the command on line 8 by hand, it actually works (it runs in console mode, if I hit Ctrl+C it stop running)! (output omitted here http://pastebay.com/138899)

But it bugs me, why does it not work when trying to start the daemon with the rc.smnpd start command? It is the same as doing it by input into console, right?

Here is the snmpd.conf: http://pastebay.com/138746
And here is the rc.snmpd: http://pastebay.com/138902

Thank you !


All times are GMT -5. The time now is 02:18 PM.