Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 33249 - net-snmp -- patch to fix 'proc' handling on Linux
Summary: net-snmp -- patch to fix 'proc' handling on Linux
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Max Kalika (RETIRED)
URL: http://sourceforge.net/mailarchive/me...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-11 13:39 UTC by Benjamin Ritcey
Modified: 2003-11-12 08:58 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
small patch to net-snmp-5.0.9-r1 to pull in the patch to proc.c (net-snmp-5.0.9-r1.ebuild.patch,438 bytes, patch)
2003-11-11 13:40 UTC, Benjamin Ritcey
Details | Diff
the patch to proc.c, from http://sourceforge.net/mailarchive/message.php?msg_id=3751940 (proc.c.diff,2.20 KB, patch)
2003-11-11 13:41 UTC, Benjamin Ritcey
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Ritcey 2003-11-11 13:40:00 UTC
The current net-snmp series (<=5.09) doesn't correctly parse the process
information under Linux;  processes that are swapped out don't register as
running, so 'proc' statements in snmpd.conf fail.  This patch (by a net-snmp
developer) changes it to use /proc/XXXX/status instead of (the current)
/proc/XXXX/cmdline.  This was fixed in CVS nine months ago but for some reason
hasn't been picked up in the last couple of releases.

NOTE:  for the last couple of releases, 'proc' has sort-of worked for
non-swapped processes, but only if you included the full path.  After this fix,
it will go back to just wanting the process name (without the path).  This is
how it's supposed to work (and, indeed, the way it works on Solaris).



Reproducible: Always
Steps to Reproduce:
1. run 'ps aux' and find a process that's swapped out - it'll be in brackets. 
kjournald usually is.
2. add 'proc kjournald' (or whatever) to your snmpd.conf & restart snmpd.
3. run "snmpwalk -v 1 -c <community name> <hostname> enterprises" -- prErrorFlag
will be set for the proccess in question, even tho it is, indeed, running.

Actual Results:  
"No kjournald process running."

Expected Results:  
no error flag.

Portage 2.0.49-r15 (default-x86-1.4, gcc-3.3.1, glibc-2.3.2-r6, 2.4.20-gentoo-r6)
=================================================================
System uname: 2.4.20-gentoo-r6 i686 Celeron (Mendocino)
Gentoo Base System version 1.4.3.11
distcc 2.11.1 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.2 [enabled]
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=i686 -O3 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config
/usr/kde/2/share/config /usr/kde/3/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -mcpu=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs sandbox ccache"
GENTOO_MIRRORS="http://moya.advisortech.com/
ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo ftp://gentoo.mirrors.pair.com/
http://csociety-ftp.ecn.purdue.edu/pub/gentoo/
ftp://ftp.ussg.iu.edu/pub/linux/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://moya.advisortech.com/gentoo-portage"
USE="x86 oss apm avi crypt encode foomaticdb gif imlib jpeg libg++ libwww mad
mikmod motif mpeg ncurses oggvorbis opengl pdflib png quicktime sdl spell svga
truetype xml2 xmms xv zlib gdbm berkdb slang readline tcpd pam ssl perl python
-kde -qt -arts -nls -gnome -gtk -X -gpm -tcltk -java -cups maildir"
Comment 1 Benjamin Ritcey 2003-11-11 13:40:49 UTC
Created attachment 20612 [details, diff]
small patch to net-snmp-5.0.9-r1 to pull in the patch to proc.c
Comment 2 Benjamin Ritcey 2003-11-11 13:41:40 UTC
Created attachment 20613 [details, diff]
the patch to proc.c, from http://sourceforge.net/mailarchive/message.php?msg_id=3751940
Comment 3 Max Kalika (RETIRED) gentoo-dev 2003-11-12 08:58:40 UTC
Had to pull the patch from net-snmp cvs (formatting was a bit off), but otherwise this is in 5.0.9-r3.