4 ms·
The article complains about not getting email when a timer-activated service fails. Like all software, if you didn't test it to work, why should you expect it
by markstos 7y ago
The article complains about not getting email when a timer-activated service fails.
Like all software, if you didn't test it to work, why should you expect it to work? Cron can fail silently as well if don't set MAILTO. Not all servers start out with working outbound mail, which is something you have to setup for both Cron and Systemd as well.
I agree the OnFailure= recipe could be documented better, although I found an example easily enough when I looked up how to have systemd timers send email on failure. I use a script which mails the output of `systemctl status` on the service that fails, so I get logs of what happens.
I've a number of questions about systemd on StackOverflow sites and there are definitely some FAQs about best practices related to getting started with setting up services.
- upofadown 7y ago>Cron can fail silently as well if don't set MAILTO. From the cron man page: > Any output produced by a command is sent to the user specified in the MAILTO environment variable as set in the crontab(5) file or, if no MAILTO variable is set (or if this is an at(1) or batch(1) job), to the job's owner.
- 1996 7y agoWith a non working mail configuration, it goes nowhere. I think the author meant that
- upofadown 7y agoIf they did mean that then they were deliberately missing the point of the original complaint.That isn't the sort of thing we are allowed to assume here...
- 1996 7y agoSo you prefer not assuming good fait? Ok. Without mail, journalctl and even better, systemctl list-timers will tell you about failed crons. Can you do something as good with at and cron?