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

Modify logrotate schema #163

Merged
merged 2 commits into from
Jan 31, 2023
Merged

Conversation

borpin
Copy link
Contributor

@borpin borpin commented Jan 29, 2023

Modify the logrotate commands to ensure all logs get rotated to the SD card by log2ram.

Changes as well because of changes to Logrotate itself.

#155 refers

@borpin
Copy link
Contributor Author

borpin commented Jan 29, 2023

Also fixes #152 and #6

@TrystanLea TrystanLea merged commit 7fb4738 into openenergymonitor:master Jan 31, 2023
@TrystanLea
Copy link
Member

Thanks @borpin I haven't tested this yet but assume this is working ok for you there? thanks for looking into this

@alexandrecuer
Copy link
Contributor

@borpin : sure you dont need copytruncate for emonhub ?
it is the only way when some programs cannot be told to close its logfile and thus might continue writing (appending) to the previous log file forever, ie nowhere

cf https://man7.org/linux/man-pages/man8/logrotate.8.html

@borpin
Copy link
Contributor Author

borpin commented Feb 1, 2023

sure you dont need copytruncate for emonhub ?

Have you read through #155 That should explain the package changes.

@borpin
Copy link
Contributor Author

borpin commented Feb 1, 2023

Thanks @borpin I haven't tested this yet but assume this is working ok for you there? thanks for looking into this

Yes working for me and removes the errors.

@borpin borpin deleted the bpo-logrotate branch February 1, 2023 19:42
@alexandrecuer
Copy link
Contributor

sure you dont need copytruncate for emonhub ?

Have you read through #155 That should explain the package changes.

Yes I read it but cannot understand through my readings why you dont need copytruncate for emonhub as it will not close its log unless something internal has been implemented into emonhub which I do not have knowledge
what I understood perfectly is that copytruncate and renamecopy options cannot work together.

@borpin
Copy link
Contributor Author

borpin commented Feb 2, 2023

I'm sure I came across something somewhere that said you could not use copytruncate' if olddir` was pointing to a different partition or device. I cannot find it again so I think I may have been wrong in that.

Looking at man, I think I may have misread this (or I found an old man page)

image

I am also sure I was getting an error with copytruncate.

Yes, I was - from #155

error: emoncms:6 olddir /var/log.old/emoncms and log file /var/log/emoncms/apache2-error.log are on different devices

I'll rebuild an SD card and test.

@borpin
Copy link
Contributor Author

borpin commented Feb 4, 2023

Ok, so in the log2ram config it has the renamecopy.

However, this should probably be in the main logrotate files as well.

I'm not sure though, if this will conflict with old systems!

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

Successfully merging this pull request may close these issues.

3 participants