emonSD next steps: filesystem & logrotate

That is true of non-emonsd installs yes!

We have mentioned not using copytruncate, how will you remove that without editing ?

We have mentioned rotating by size and that all softwares should not be treated equally, we cannot cap emonhub at 1M just because we have so many other logs, setting a size for each offers greater flexibility.

The olddir is currently set for a global "log,old` folder, so all logs will get dumped in the one folder. If you want to preserve the folder structure you can define olddir in each conf so that olddir for apache2 (for example) is /var/log.old/apache2. Yes we could move the files afterwards instead of changing olddir, but that would be in a post-rotation so still need to edit the conf files.

Some logs eg apache access may not need retaining so those logs could be deleted or truncated so that recent access is held in ram but not kept on disk.

The limits and settings for emonsd may not be ideal for a hdd server, so different versions maybe better.

If you commit to NOT editing any existing files, then you are stuck with never editing any conf’s as you cannot really start “tinkering” with sed etc in the update scripts. A second copy in a repo allows editing via updates without any “tinkering”.

If there was anyway to just stick with the (untouched) defaults I would jump at it, that was the original intention for the 00_olddir conf file, but the more I look at logrotate, the more I think that a custom system wide conf is needed.

This is nothing to do with L2R really. All L2R is actually doing is maintaining the ram folder structure and keeping the tmpfs sync’d so as not to lose logs.

logrotate is the focus for managing what comes out of ram and what gets kept. logrotate maybe writing to disk more than L2R does, depending on setup. It’s in the logrotation config that you manage and fine tune how well the tmpfs and persistence works, and the defaults were not designed for either SDcard or tmpfs logs, I would be very surprised if we couldn’t improve things via the logrotate conf. This is the main conf area for the emonsd logging.