Log file used on usb is not used upon device reboot

I want to keep my logs so I am trying to use logrotate.

when I set the file path for log file in /etc/config/system and then restart the log service, then logs are written to the file I specified on the attacked usb drive.

but when I restart the device the logs are not written to it and I need to manually restart log service again.

I know the usb drive probably loads after the log service is running but I thought log service took care of it if I changed log file path to usb.

what am I doing wrong?

How are you mounting the external storage?

from luci mount points.

“Mount Points

Mount Points define at which point a memory device will be attached to the filesystem”

This is fixed in the development branch

but has not been backported to stable.

You can copy the version of the initscript in the above pull request (or from the current development branch) to /etc/init.d/log . To preserve across sysupgrade add /etc/init.d/log to /etc/sysupgrade.conf But don’t forget to remove it once development becomes the stable branch.

thank you for the answer.

right now I got the issue “fixed” by adding

logread >> /mnt/usb/mylog
/etc/init.d/log restart

to the local startup scripts (rc.local)

will remove it once new release is done.

by the way is there any roadmap or release table for next version of openwrt?

also, where should I report bugs? here or on github?

is here more suitable for general bug reports and questions that can’t be narrowed down to components?

That’s a nice workaround. I do not know of a timetable of any kind, but I also am not an active OpenWrt developer - in recent years that one PR is all I have submitted. I am hoping to do more, but time gets away from me.

For someone who is not a developer the general recommended course of action is to first post on the forum (to verify that it is a code bug and not a configuration error or missing, incomplete, or incorrect documentation - those some of those count as another kind of bug). For an actual bug, I think the usual place now is GitHub Issues on the appropriate repo.

For the final question, it depends on the nature of the bug (if a bug indeed). Questions are preferred to be asked on the forum (or in rare cases, the developer mailing list) rather than entered as an issue.

HTH.

1 Like