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

Once /var/log fills up the update can no longer run #159

Open
borpin opened this issue Jan 29, 2023 · 4 comments
Open

Once /var/log fills up the update can no longer run #159

borpin opened this issue Jan 29, 2023 · 4 comments

Comments

@borpin
Copy link
Contributor

borpin commented Jan 29, 2023

#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?

Originally posted by @glynhudson in #81 (comment)

@TrystanLea
Copy link
Member

Ok so will still need a script of some sort to check and clear logs if full ? Should the logrotate config not fix this by ensuring that the sum of all logs cannot exceed the log partition size?

@borpin
Copy link
Contributor Author

borpin commented Feb 1, 2023

Ok so will still need a script of some sort to check and clear logs if full ? Should the logrotate config not fix this by ensuring that the sum of all logs cannot exceed the log partition size?

Yes, this problem may be so old as to ignore now. I doubt there are any systems still out there that are unable to update because of this.

@borpin
Copy link
Contributor Author

borpin commented Feb 4, 2023

Ha, yes there could be - had an emonhub log fill up :(

@CDuffers
Copy link
Contributor

Morning,

Checking and clearing space before we run is always a good thing to do.

I suggest that we need to enhance the error checking through the scripts to pick up this and any other quirks and foibles along the way.

I'm working on an enhancement to emoncms-export.sh within the backup module, my current approach is to run a trap on error which shows the RC and LINENO before allowing it to continue, then also a trap on EXIT to summarise if it completed successfully or with error. The idea being to highlight a problem rather than stop and perform some more invasive controls, which I thought was too strong a change at this point.

This might be helpful for the install and update scripts as well as it MIGHT have highlighted the root cause from this issue #179

This is likely to requite rethinking of some code to prevent non-zero return codes for commands like grep when it can't find something. e.g. $(ls /boot | grep emonSD) when run on my Ubuntu VM

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