Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/var/log filling up #81

Closed
borpin opened this issue Apr 9, 2020 · 4 comments
Closed

/var/log filling up #81

borpin opened this issue Apr 9, 2020 · 4 comments

Comments

@borpin
Copy link
Contributor

borpin commented Apr 9, 2020

/var/log is filling up again. https://community.openenergymonitor.org/t/var-log-filling-up-again/13808/

This is because the logrotate.log file is not being rotated!

I have added a rotation spec into my 00_defaults file to see what happens. Not sure how it will react to rotating itself.

However, you need to

sudo truncate -s 0 /var/log/logrotate/logrotate.log

the file first otherwise the logrotate fails as there is not enough room to write the file.

Will need to be added to the update script.

@TrystanLea
Copy link
Member

Thanks @borpin good to know, how long did this take to fill up, I dont think I've noticed this?

@borpin
Copy link
Contributor Author

borpin commented Apr 9, 2020

It does take a while but we have had one report on the community I think.

do a

sudo du -a /var/log/* | sort -n -r | head -n 30

to see if it is the largest file.

In the last 5 hours the log has grown about 8k per hour I'd estimate

It will be a bit insidious as the log grow slowly. When the problem occurs depends on how much you are logging other things.

I'd suggest a truncate command is added to the update script to at least mitigate it.

@glynhudson
Copy link
Member

#85 solves the issue of logrotate not rotating it's own logs. However it does not solve the issue of once /var/log fills up the update can no longer run.

@TrystanLea what do you think of adding a check right at the beginning of the update script to check if if /var/log is full and if so truncate the largest log? As suggested by @borpin on this thread. Or maybe use a different location for emonpiupdate.log?

@borpin
Copy link
Contributor Author

borpin commented Jan 29, 2023

#159 opened

@borpin borpin closed this as completed Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants