SomeArmbianForumUser Posted January 21, 2018 Posted January 21, 2018 Thanks for Ramlog. I have installed Armbian_5.35_Micro_Debian_stretch_next_4.13.16 and not done anything in terms of Ramlog setup. What should I do when it is full? Or to avoid that it gets full? Symptoms: * Aptitude complained about "no space left on device" on exit. * df: root@micro:~# df -h Filesystem Size Used Avail Use% Mounted on udev 432M 0 432M 0% /dev tmpfs 100M 12M 89M 12% /run /dev/mmcblk0p1 29G 3.0G 26G 11% / tmpfs 499M 0 499M 0% /dev/shm tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 499M 0 499M 0% /sys/fs/cgroup tmpfs 499M 36K 499M 1% /tmp log2ram 50M 50M 0 100% /var/log tmpfs 100M 0 100M 0% /run/user/0 * usage: root@micro:~# du /var/log/* | sort -n 0 /var/log/armhwinfo.log 0 /var/log/debug 0 /var/log/influxdb 0 /var/log/ntpstats 0 /var/log/sysstat 0 /var/log/user.log 4 /var/log/btmp 4 /var/log/debug.1 4 /var/log/kern.log 4 /var/log/messages 8 /var/log/aptitude 8 /var/log/auth.log 8 /var/log/unattended-upgrades 24 /var/log/faillog 28 /var/log/wtmp 36 /var/log/user.log.1 44 /var/log/alternatives.log 48 /var/log/armhwinfo.log.1.gz 52 /var/log/syslog.3.gz 60 /var/log/bootstrap.log 136 /var/log/auth.log.1 140 /var/log/apt 160 /var/log/kern.log.1 192 /var/log/messages.1 248 /var/log/syslog.2.gz 288 /var/log/lastlog 348 /var/log/dpkg.log 3060 /var/log/daemon.log 3092 /var/log/syslog 10208 /var/log/openhab2 14912 /var/log/syslog.1 18084 /var/log/daemon.log.1 I know that openHAB2 is causing the majority of the log messages. That's the purpose of that computer. How can I increase the amount of RAM used for Ramlog, or make the log rotation more aggressive?
Tido Posted January 21, 2018 Posted January 21, 2018 to have the complete picture, can you also do: armbianmonitor -u
SomeArmbianForumUser Posted January 21, 2018 Author Posted January 21, 2018 Apparently, I can't: root@micro:~# armbianmonitor -u System diagnosis information will now be uploaded to /usr/bin/armbianmonitor: line 374: [: -gt: unary operator expected /usr/bin/armbianmonitor: line 374: [: -gt: unary operator expected /usr/bin/armbianmonitor: line 374: [: -gt: unary operator expected /usr/bin/armbianmonitor: line 374: [: -gt: unary operator expected <html> <head> <title>500 Internal Server Error</title> </head> <body> <h1>500 Internal Server Error</h1> The server has either erred or is incapable of performing the requested operation.<br /><br /> </body> </html>Please post the URL in the forum where you've been asked for. Interesting. In the meantime I had deleted the largest file in /var/log, but this is not reflected in the output of df for the log2ram filesystem. After the armbianmonitor error, I tried rebooting and manually unmounting /var/log in an attempt to maybe get armbianmonitor -u to work, but no success. My openhab2 continues to run just fine on that device.
SomeArmbianForumUser Posted January 21, 2018 Author Posted January 21, 2018 I have now found root@micro:~# find / -name log2ram* /etc/default/log2ram Where I can increase the size of that file system. I can still not upload armbianmonitor - seems like the armbian server has trouble: root@micro:~# armbianmonitor -u System diagnosis information will now be uploaded to curl: (56) Recv failure: Connection reset by peer Please post the URL in the forum where you've been asked for. root@micro:~# armbianmonitor -u System diagnosis information will now be uploaded to <html> <head> <title>500 Internal Server Error</title> </head> <body> <h1>500 Internal Server Error</h1> The server has either erred or is incapable of performing the requested operation.<br /><br /> </body> </html>Please post the URL in the forum where you've been asked for. root@micro:~# armbianmonitor -u System diagnosis information will now be uploaded to <html> <head> <title>500 Internal Server Error</title> </head> <body> <h1>500 Internal Server Error</h1> The server has either erred or is incapable of performing the requested operation.<br /><br /> </body> </html>Please post the URL in the forum where you've been asked for. I would still like advice how to increase the logrotate aggressiveness - delete old logs earlier, so they do not take as much space in ramlog.
Igor Posted January 22, 2018 Posted January 22, 2018 6 hours ago, SomeArmbianForumUser said: I can still not upload armbianmonitor - seems like the armbian server has trouble: External services which we used to use is down. It was already changed in the trunk but haven't got to the stable builds yet. If you move to beta (and risk other possible problems) and update ... Quote What should I do when it is full? Or to avoid that it gets full? The general advice is to pay attention not to fill it up, otherwise, tweak this problem with some script. You could also make it bigger but again not too big, to lose memory.
SomeArmbianForumUser Posted January 23, 2018 Author Posted January 23, 2018 For more aggressive log rotation, I have now changed /etc/logrotate.d/rsyslog like this: root@micro:~# diff /etc/logrotate.d/rsyslog{~,} -u --- /etc/logrotate.d/rsyslog~ 2017-01-18 23:14:38.000000000 +0100 +++ /etc/logrotate.d/rsyslog 2018-01-23 13:25:45.141409984 +0100 @@ -1,10 +1,9 @@ /var/log/syslog { - rotate 7 + rotate 4 daily missingok - notifempty - delaycompress + ifempty compress postrotate invoke-rc.d rsyslog rotate > /dev/null @@ -25,11 +24,10 @@ /var/log/messages { rotate 4 - weekly + daily missingok - notifempty + ifempty compress - delaycompress sharedscripts postrotate invoke-rc.d rsyslog rotate > /dev/null And created a new logrotate file for openhab2: root@micro:~# cat /etc/logrotate.d/openhab2 /var/log/openhab2/*.log { rotate 4 daily missingok ifempty compress postrotate service openhab2 restart endscript } Invoking these files with logrotate --force --verbose <filename> produces no error, and performs the expected operations. If this works out in the long run, I can probably reduce the ramlog size back to 50MB.
Recommended Posts