Bug ID 1202361
Summary net-snmp logrotate will not reload snmpd.service and opened and delete net-snmpd.log will eat all free space
Classification openSUSE
Product openSUSE Distribution
Version Leap 15.3
Hardware Other
OS Other
Status NEW
Severity Major
Priority P5 - None
Component Basesystem
Assignee screening-team-bugs@suse.de
Reporter michal.siska@cs-soft.cz
QA Contact qa-bugs@suse.de
Found By ---
Blocker ---

All our openSUSE Leap 15.3 servers had full disk in df, while du shows not that
much used space. The problem is in logrotate for net-snmp.log and not working
postrotate skript. Here is full demonstration:

localhost:~ # df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        4,0M     0  4,0M   0% /dev
tmpfs           3,9G     0  3,9G   0% /dev/shm
tmpfs           1,6G  157M  1,5G  10% /run
tmpfs           4,0M     0  4,0M   0% /sys/fs/cgroup
/dev/sda2        78G   78G     0 100% /
tmpfs           796M   52K  796M   1% /run/user/26
tmpfs           796M   52K  796M   1% /run/user/0

localhost:~ # lsof +L1
COMMAND  PID USER   FD   TYPE DEVICE    SIZE/OFF NLINK    NODE NAME
snmpd   1630 root    3w   REG    8,2 63071232000     0 2098987
/var/log/net-snmpd.log-20220628 (deleted)
snmpd   1630 root    8w   REG    8,2 63071232000     0 2098987
/var/log/net-snmpd.log-20220628 (deleted)

localhost:~ # systemctl reload snmpd.service

localhost:~ # lsof +L1
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NLINK  NODE NAME

localhost:~ # df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        4,0M     0  4,0M   0% /dev
tmpfs           3,9G     0  3,9G   0% /dev/shm
tmpfs           1,6G  157M  1,5G  10% /run
tmpfs           4,0M     0  4,0M   0% /sys/fs/cgroup
/dev/sda2        78G   19G   55G  26% /
tmpfs           796M   52K  796M   1% /run/user/26
tmpfs           796M   52K  796M   1% /run/user/0

localhost:~ # cat /etc/logrotate.d/net-snmp 
/var/log/net-snmpd.log {
   compress
   dateext
   maxage 365
   rotate 99
   size=+1024k
   notifempty
   missingok
   create 600 root root
   su root root
   sharedscripts
   postrotate
       /etc/init.d/snmpd reload ||:
       if [ -x /etc/init.d/snmptrapd ] ; then \
          /etc/init.d/snmptrapd reload ||: ; \
       fi
   endscript

}

localhost:~ # /etc/init.d/snmpd reload
-bash: /etc/init.d/snmpd: No such file or directory


You are receiving this mail because: