Open dieskim opened 1 year ago
I belive this is due to the rtn18u using rsyslogd and not syslogd
The Asus firmware runs syslogd with a logrotation enabled while nothing is currently set up to logrotate with rsyslogd
We would need to do something like this: https://www.rsyslog.com/doc/master/tutorials/log_rotation_fix_size.html
Hi dieskim, you are right. The rsyslog seems to not configure properly in current firmware and I will try to fix this problem.
You might need to manually remove /jffs/syslog.log if it gets a large file.
Is there any way to just switch to syslogd or is that not possible? Since that would not need any additional scripts as rsyslog does.
If you don’t mind me asking, when do you think you would be able to work on this fix? If it’s going to be a while I will need to write my own script to rotate the logs for now.
FYI to anyone else who needs a fix for this for now, I added an services-start
user script with the following, this rotates the logs on reboot, saving the last 10k lines.
#!/bin/sh
logger "services-start" "startup"
# check if rsyslogd - clear and rotate logs
logger "services-start" "check if rsyslogd installed"
if type rsyslogd &> /dev/null
then
logger "services-start" "rsyslogd installed - rotating syslog"
# clear jffs logs
> /jffs/syslog.log
> /jffs/syslog.log-1
# move last 10k lines to from /tmp/syslog.log to /tmp/syslog.log-1
tail -n 10000 /tmp/syslog.log > /tmp/syslog.log-1
# clear /tmp/syslog.log
> /tmp/syslog.log
fi
I can apply the log rotation solution by using built-in output channels feature in rsyslog now.
Please see the preview patch, based on tag rtn18u_386.3_1, if someone would like to double check this solution before the next release.
Hi, firstly thanks for you long term work and support for this router.
I am having an issue on my router where it does not seem to rotate the syslog.log file, this file then grows until the router gets filled up. I believe the log should be rotate at a certain size as I am seeing this happen on another router running Asus Merlin.
See current output from my router:
Is this a bug or something I can fix on my side?
I am running 386.3 so maybe if I upgrade to 386.3.1 it might fix it?