Thank you very much for implementing this. Just for the record, the related commits are linked here: https://sourceforge.net/p/logwatch/git/ci/014fed6375a57d94a2d568b1cf2a835d7113c8f5/ https://sourceforge.net/p/logwatch/git/ci/02349abdbdb746ffa34a17c5ae793b5e861bd47d/ https://sourceforge.net/p/logwatch/git/ci/e8ca7f728e01e156324a3acd5517b3292a051b94/ In summary, anyone can customize systemd.service behaviour as per their wish by editing systemd.conf file.
Thank you very much for the implementation. However in my opinion, --mailto root should not be made default in LOGWATCH_OPTIONS. Because: 1. It is anyway the default when --output mail is specified. So it is redundant. 2. If I want to change my mailto address, I would most likely change in logwatch.conf file instead. So it applies globally to all the emails that come via Logwatch. But systemd.service file will still continue to send email to root and I will have to change mailto at two places. (logwatch.conf...
There is another option which satisfies all cases by modifying systemd service file (logwatch.service) as follows. [Service] Type=oneshot EnvironmentFile=-/etc/logwatch/systemd.conf ExecStart=/usr/sbin/logwatch $EXEC_OPTIONS The file, /etc/logwatch/systemd.conf, may or may not exist. A minus (-) sign infront of filename makes sure that it is not an error if file does not exist. Anyone who wants a different option can create that file (/etc/logwatch/systemd.conf) and put something like this: EXEC_OPTIONS="--output...
There is another option which satisfies all cases by modifying systemd service file (logwatch.service) as follows. [Service] Type=oneshot EnvironmentFile=-/etc/logwatch/systemd.conf ExecStart=/usr/sbin/logwatch $EXEC_OPTIONS This file may or may not exist. A minus (-) sign infront of filename makes sure that it is not an error if file does not exist. Anyone who wants a different option can create that file (/etc/logwatch/systemd.conf) and put something like this: EXEC_OPTIONS="--output mail" This...
There is another option which satisfies all cases by modifying systemd service file (logwatch.service) as follows. [Service] Type=oneshot EnvironmentFile=-/etc/logwatch/systemd.conf ExecStart=/usr/sbin/logwatch $EXEC_OPTIONS This file may or may not exists. A minus (-) sign infront of filename makes sure that it is not an error if file does not exist. Anyone who wants to a different option can create that file (/etc/logwatch/systemd.conf) and put something like this: EXEC_OPTIONS="--output mail"...
There is another option which satisfies all cases by modifying systemd service file (logwatch.service) as follows. [Service] Type=oneshot EnvironmentFile=-/etc/logwatch/systemd.conf ExecStart=/usr/sbin/logwatch $EXEC_OPTIONS This file may or may not exists. A minus (-) sign infront of filename makes sure that it is not an error if file does not exist. Anyone who wants to a different option can create that file (/etc/logwatch/systemd.conf) and put something like this: EXEC_OPTIONS="--output mail"...
You configure that with Output = mail inside /etc/logwatch/conf/logwatch.conf Putting Output = mail in default as logwatch.conf means that even when I run it on command line, it sends a mail, which may not always be desired. No reason to send mail (to whom?) by default systemd.timer is meant to be a replacement for cron. (That is the purpose of this feature request). By default cron sends email to root. So we can expect similar functionality from logwatch systemd.timer. And logwatch.conf by default...
Current logwatch .service file is strange and purpose less. By default it sends output to systemd which in turn will send output back to journal. It would be strange that logwatch runs everyday .. parses log files and sends the report back to logs!! (journal) instead of sending an email to root (the cron default behaviour) I would suggest replacing ExecStart=/usr/sbin/logwatch with ExecStart=/usr/sbin/logwatch --output mail Then functionality will become same as that of cron. Please consider