Tiny Core Base > TCB Q&A Forum
/var/log/wtmp rotating?
Stefann:
Hi,
I see /var/log/wtmp growing.
Is it at anytime getting rotated or flushed?
Until now I did reboot tcl from time to time and with that it got restarted.
Recently however I added /var/log to .filetool.lst for reason that I like to have my logs persistent over reboots.
My server works as a 24/7 homecontrol server. I have disabled logging from standard applications (like Apache) as I never look to them anyways. I have my own application now logged with rsyslog with which I successfully got the rotation working.
However… I now see /var/log/wtmp growing.
I can/could definitely create a rotation or flush for it myself with some cron job, but actually I feel this should be a default or standard setting.
In practice it will take few month before this becomes a problem. By default /var/log is not part of .filetool.lst so it’s very. Likely in default it gets flushed by a reboot every few month.
Still however… it seems to be a file that is growing without control.
Or… does it get flushed some day?
curaga:
No, busybox doesn't look like it supports rotating wtmp and utmp. You can clear it manually, or use a package like logrotate.
Stefann:
Ah,
I will solve this one way or the other.
I think I will do by cron job because I already have that running while log rotate would be something I would need to add.
With that said however...
Isn't it a bit as a vulnerability that TC "out of the box without extra apps" has a growing log?
Would it be an idea to add something "basic" in next TC release?
Maybe a std cron configuration that has a line like:
1 1 1 * * echo ' ' > /var/log/wtmp
(where overwriting with something empty is better practice than removal of the file)
Stefann:
Well,
To keep things simple
I added below line to my cron file:
--- Code: ---1 1 1 * * /bin/echo > /var/log/wtmp
--- End code ---
This will flush wtmp monthly.
Tested it with all * (every minute) and works
patrikg:
Sorry to tell your echo will not empty out the file, you get one char line feed(new line).
You have to provide option -n to disable echo auto ending the line with line feed.
--- Code: ---1 1 1 * * /bin/echo -n > /var/log/wtmp
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version