Description of problem: The service snmpd can not startup, because kmem is disable in kernel, but not disables in snmpd service. Version-Release number of selected component (if applicable): 5.8-2 How reproducible: every time Steps to Reproduce: 1. urpmi net-snmp-utils-5.8-2 2. systemctl start snmpd 3. systemctl status snmpd # cat /boot/config-5.3.11-server-1.mga7 |fgrep DEVKMEM # CONFIG_DEVKMEM is not set # systemctl status snmpd | grep kmem nov 26 13:02:54 Z1 snmpd[10199]: /dev/kmem: No such file or directory
Please test with upcoming net-snmp-5.8-2.1.mga7 in Core/Updates_testing repo!
CC: (none) => geiger.david68210
Hi David, I test net-snmp-5.8-2.1.mga7. The issue is not resolved. # whereis snmpd snmpd: /usr/sbin/snmpd /usr/share/man/man8/snmpd.8.xz # rpm -qf /usr/sbin/snmpd net-snmp-5.8-2.1.mga7 # strace /usr/sbin/snmpd ... fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 write(3, "/dev/kmem: No such file or direc"..., 37) = 37 openat(AT_FDCWD, "/dev/mem", O_RDONLY) = 4 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 pipe([5, 6]) = 0 futex(0x7ffbbd13b398, FUTEX_WAKE_PRIVATE, 2147483647) = 0 futex(0x7ffbbd13b38c, FUTEX_WAKE_PRIVATE, 2147483647) = 0 futex(0x7ffbbd13b1d0, FUTEX_WAKE_PRIVATE, 2147483647) = 0 futex(0x7ffbbd13b480, FUTEX_WAKE_PRIVATE, 2147483647) = 0 futex(0x7ffbbd13b374, FUTEX_WAKE_PRIVATE, 2147483647) = 0 futex(0x7ffbbd13b36c, FUTEX_WAKE_PRIVATE, 2147483647) = 0 futex(0x7ffbbd13b244, FUTEX_WAKE_PRIVATE, 2147483647) = 0 gettimeofday({tv_sec=1574777130, tv_usec=780547}, NULL) = 0 write(3, "Agent initialization failed\n", 28) = 28 futex(0x7ffbbd13b96c, FUTEX_WAKE_PRIVATE, 2147483647) = 0 exit_group(1) = ? +++ exited with 1 +++
Tested here and now snmpd service works fine! Have you update all your net-snmp installed packages? net-snmp-5.8-2.1.mga7 lib(64)net-snmp35-5.8-2.1.mga7 lib(64)net-snmp-devel-5.8-2.1.mga7 net-snmp-utils-5.8-2.1.mga7 net-snmp-tkmib-5.8-2.1.mga7 net-snmp-mibs-5.8-2.1.mga7 net-snmp-trapd-5.8-2.1.mga7 perl-NetSNMP-5.8-2.1.mga7 python-netsnmp-5.8-2.1.mga7
Hi David # rpm -qa |grep -i snmp + net-snmp-utils-5.8-2.1.mga7 + net-snmp-5.8-2.1.mga7 * php-snmp-7.3.11-1.mga7 * perl-NetSNMP-5.8-2.mga7 * freeswitch-event-snmp-1.6.20-6.mga7 - net-snmp-mibs-5.8-2.mga7 * perl-Net-SNMP-6.0.1-9.mga7 * nagios-check_snmp-2.2.1-4.mga7 + lib64net-snmp-devel-5.8-2.1.mga7 + lib64net-snmp35-5.8-2.1.mga7 + updated - not updated (not requered IHMO) * other rpm I want double check. Please, provide me follow outputs: ls -l /dev/kmem md5sum /usr/sbin/snmpd md5sum /usr/lib64/libnetsnmp.so.35.0.0 md5sum /usr/lib64/libsnmp.so.35.0.0 /dev/kmem - file is not exists 4f779a53188cd640fdee3f3880648c5e /usr/sbin/snmpd 338d0158064debe954b378b40f60e3f9 /usr/lib64/libnetsnmp.so.35.0.0 19816429a5ffd050ea52d98a3d408311 /usr/lib64/libsnmp.so.35.0.0
Hi David, Option "-r" resolve issue. # snmpd -Mmibs -f -Lo /dev/kmem: No such file or directory Agent initialization failed # snmpd -Mmibs -f -Lo -r 2019-11-26 22:40:20 MIB search path: mibs ... 2019-11-26 22:40:20 Turning on AgentX master support. 2019-11-26 22:40:22 NET-SNMP version 5.8 ^C2019-11-26 22:40:25 Received TERM or STOP signal... shutting down... -r Do not require root access to run the daemon. Specifically, do not exit if files only accessible to root (such as /dev/kmem etc.) cannot be opened. Thank you!
Thank you both for dealing with this so rapidly. I am unsure whether the need for the -r option (with the updated packages) in itself resolves the initial bug description. If so, this can be pushed to QA after a suitable advisory - which could mention the fact. It will be too easy to see the same bug reported again even after the update... In the meantime, excuse me once more for assigning this to you David, as you already have done it.
Assignee: bugsquad => geiger.david68210
Hmmm! something is strange between our BS and a mga7 user system: On BS we can see that it search /dev/kmem and found it: checking for /dev/kmem... /dev/kmem And on my mga7 system it doesn't found it: checking for /dev/kmem... @tmb Have you an idea on why this difference?
I suppose difference in kernel options. # uname -a Linux Z1 5.3.11-server-1.mga7 #1 SMP Tue Nov 12 21:38:05 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux # cat /boot/config-5.3.11-server-1.mga7 |fgrep DEVKMEM # CONFIG_DEVKMEM is not set
# uname -a Linux david.david 5.3.11-desktop-1.mga7 #1 SMP Tue Nov 12 21:10:01 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux # cat /boot/config-5.3.11-desktop-1.mga7 |fgrep DEVKMEM # CONFIG_DEVKMEM is not set
"On BS we can see that it search /dev/kmem and found it: checking for /dev/kmem... /dev/kmem" Is BS building system? I say that need check kernel option on building system.
Yes it is our Build System.
Thanks. Who check kernel option of Build System?
the buildsystem runs on standard Mageia 7 server kernels, but since this is iurt chroots, I guess we meed to update makedev to not create kmem anymore
CC: (none) => tmb
(In reply to Thomas Backlund from comment #13) > the buildsystem runs on standard Mageia 7 server kernels, but since this is > iurt chroots, I guess we meed to update makedev to not create kmem anymore Are you on it Thomas? I don't know how to fix it in makedev.
FYI, WA: https://sourceforge.net/p/net-snmp/mailman/message/16165557/ You can set the no root access flag, and the agent will run fine without root access. Or, reconfigure the agent, and specify '--with-cflags=-DNO_KMEM_USAGE'.
So please test net-snmp-5.8-2.2.mga7.
negative. [zamir@Z1 ~]$ ls -l *.rpm -rw-rw-r-- 1 zamir zamir 1008332 дек 12 10:19 lib64net-snmp35-5.8-2.2.mga7.x86_64.rpm -rw-rw-r-- 1 zamir zamir 1175408 дек 12 10:19 lib64net-snmp-devel-5.8-2.2.mga7.x86_64.rpm -rw-rw-r-- 1 zamir zamir 188720 дек 12 10:19 net-snmp-5.8-2.2.mga7.x86_64.rpm -rw-rw-r-- 1 zamir zamir 270872 дек 12 10:19 net-snmp-mibs-5.8-2.2.mga7.x86_64.rpm -rw-rw-r-- 1 zamir zamir 357172 дек 12 10:19 net-snmp-utils-5.8-2.2.mga7.x86_64.rpm -rw-rw-r-- 1 zamir zamir 155396 дек 12 10:19 perl-NetSNMP-5.8-2.2.mga7.x86_64.rpm [zamir@Z1 ~]$ sudo rpm -vU ./*.rpm Verifying packages... Подготовка пакетов... lib64net-snmp35-5.8-2.2.mga7.x86_64 net-snmp-mibs-5.8-2.2.mga7.x86_64 perl-NetSNMP-5.8-2.2.mga7.x86_64 net-snmp-utils-5.8-2.2.mga7.x86_64 net-snmp-5.8-2.2.mga7.x86_64 lib64net-snmp-devel-5.8-2.2.mga7.x86_64 lib64net-snmp-devel-5.8-2.1.mga7.x86_64 net-snmp-5.8-2.1.mga7.x86_64 net-snmp-utils-5.8-2.1.mga7.x86_64 perl-NetSNMP-5.8-2.mga7.x86_64 net-snmp-mibs-5.8-2.mga7.x86_64 lib64net-snmp35-5.8-2.1.mga7.x86_64 [zamir@Z1 ~]$ sudo su [root@Z1 zamir]# snmpd -Mmibs -f -Lo /dev/kmem: No such file or directory Agent initialization failed [root@Z1 zamir]# snmpd -Mmibs -f -Lo -r 2019-12-12 15:14:17 MIB search path: mibs 2019-12-12 15:14:17 Cannot find module (SNMPv2-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (IF-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (IP-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (TCP-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (UDP-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (HOST-RESOURCES-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (NOTIFICATION-LOG-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (DISMAN-EVENT-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (DISMAN-SCHEDULE-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (EtherLike-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (HOST-RESOURCES-TYPES): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (MTA-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (NETWORK-SERVICES-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (RMON-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (SCTP-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (UCD-DISKIO-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (LM-SENSORS-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (UCD-SNMP-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (UCD-DEMO-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (SNMP-TARGET-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (NET-SNMP-AGENT-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (SNMP-FRAMEWORK-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (SNMP-MPD-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (SNMP-USER-BASED-SM-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (SNMP-VIEW-BASED-ACM-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (SNMP-COMMUNITY-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (IPV6-ICMP-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (IPV6-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (IPV6-TCP-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (IPV6-UDP-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (IP-FORWARD-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (NET-SNMP-PASS-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (NET-SNMP-EXTEND-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (UCD-DLMOD-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (SNMP-NOTIFICATION-MIB): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (SNMPv2-TM): At line 0 in (none) 2019-12-12 15:14:17 Cannot find module (NET-SNMP-VACM-MIB): At line 0 in (none) 2019-12-12 15:14:17 Turning on AgentX master support. 2019-12-12 15:14:17 Error opening specified endpoint "" 2019-12-12 15:14:17 Server Exiting with code 1 [root@Z1 zamir]#
I have added what upstream proposed: '--with-cflags=-DNO_KMEM_USAGE' So why this doesn't work?
http://svnweb.mageia.org/packages?view=revision&revision=1465965
Yes, thanks, I checked srpm. Everything seems to be right. I don’t know why it didn’t work :(
I added --without-kmem-usage to the configure line and rebuilt the SRPM, snmpd now runs for me.
CC: (none) => srowe
Depends on: (none) => 27034
@Zamir and @Simon, Does this really work with proposed configure option in Comment 21?
CC: (none) => ouaurelienWhiteboard: (none) => NEEDINFO
I've got the following to patch configure @@ -234,6 +234,7 @@ %else --without-rpm \ %endif + --without-kmem-usage \ --disable-static \ --enable-shared \ --with-cflags="%{optflags} -D_RPM_4_4_COMPAT -fPIE" \ I've also got the following for reasons I don't remember @@ -461,6 +462,7 @@ %{_mandir}/man1/snmpwalk.1* %{_mandir}/man1/traptoemail.1* %{_mandir}/man5/mib2c.conf.5* +%exclude %{_bindir}/snmppcap %files mibs %doc mibs/README.mibs Package has been used by cacti for over six months now.
I have not tested other solutions and I trust Simon. I think the option "--without-kmem-usage" completely removes support kmem. Currently I use option "-r" from comment5. This option disable using kmem. # systemctl status snmpd ● snmpd.service - Simple Network Management Protocol (SNMP) Daemon. Loaded: loaded (/usr/lib/systemd/system/snmpd.service; enabled; vendor preset: disabled) Active: active (running) since Fri 2020-08-28 13:20:04 MSK; 1 months 4 days ago Main PID: 8661 (snmpd) Tasks: 1 (limit: 4915) Memory: 12.3M CGroup: /system.slice/snmpd.service └─8661 /usr/sbin/snmpd -r -LS0-4d -f
Mageia 7 is EOL since July 1st 2021. There will not have any further bugfix for this release. You are encouraged to upgrade to Mageia 8 as soon as possible. @reporter, if this bug still apply with Mageia 8, please let us know it. @packager, if you work on the Mageia 7 version of your package, please check the Mageia 8 package if issue is also present. In this case, please fix the Mageia 8 version instead. This bug report will be closed OLD if there is no further notice within 1st September 2021.
Hi bug reporter and hi assignee and others involved, Please reopen this bug report if it is still valid for Mageia 8 or 9(cauldron), and change "Version:" in the upper left of this report accordingly. This report is being closed as OLD because it was filed against Mageia 7, for which support ended on June 30th 2021. Thanks, Marja
Status: NEW => RESOLVEDResolution: (none) => OLD