snmptrapd starts ok using systemctl, however it gives errors when trying to access MIB files.
It gives permission denied for all files in my MIB directory, but here is just one example:
[root@CentOS-CS log]# grep CISCO-PRODUCTS-MIB snmptrapd.log
/home/csandin/mibs/CISCO-PRODUCTS-MIB.my: Permission denied
[root@CentOS-CS log]# ls -l /home/csandin/mibs/CISCO-PRODUCTS-MIB.my
-rw-r--r--. 1 csandin csandin 424267 Aug 22 01:10 /home/csandin/mibs/CISCO-PRODUCTS-MIB.my
[root@CentOS-CS log]#
It is running as root, so it makes no sense to me why it cannot access these files.
[root@CentOS-CS log]# ps -ef|grep snmptrapd
root 2805 1 0 15:39 ? 00:00:00 /usr/sbin/snmptrapd -f -M +/home/csandin/mibs -m ALL -Lf /var/log/snmptrapd.log udp:162,udp6:162
root 2835 2775 0 16:19 pts/0 00:00:00 grep --color=auto snmptrapd
[root@CentOS-CS log]#
If I start snmptrapd manually as root I do not get those permission errors.
I am using the following OS:
[root@CentOS-CS log]# rpm -qa|grep release
centos-stream-release-9.0-22.el9.noarch
[root@CentOS-CS log]#
Does anyone have any clues on why it cannot access these files when started via systemctl?
It gives permission denied for all files in my MIB directory, but here is just one example:
[root@CentOS-CS log]# grep CISCO-PRODUCTS-MIB snmptrapd.log
/home/csandin/mibs/CISCO-PRODUCTS-MIB.my: Permission denied
[root@CentOS-CS log]# ls -l /home/csandin/mibs/CISCO-PRODUCTS-MIB.my
-rw-r--r--. 1 csandin csandin 424267 Aug 22 01:10 /home/csandin/mibs/CISCO-PRODUCTS-MIB.my
[root@CentOS-CS log]#
It is running as root, so it makes no sense to me why it cannot access these files.
[root@CentOS-CS log]# ps -ef|grep snmptrapd
root 2805 1 0 15:39 ? 00:00:00 /usr/sbin/snmptrapd -f -M +/home/csandin/mibs -m ALL -Lf /var/log/snmptrapd.log udp:162,udp6:162
root 2835 2775 0 16:19 pts/0 00:00:00 grep --color=auto snmptrapd
[root@CentOS-CS log]#
If I start snmptrapd manually as root I do not get those permission errors.
I am using the following OS:
[root@CentOS-CS log]# rpm -qa|grep release
centos-stream-release-9.0-22.el9.noarch
[root@CentOS-CS log]#
Does anyone have any clues on why it cannot access these files when started via systemctl?
Statistics: Posted by csandin — 2023/09/01 16:43:06
Distro