News for hackers. Stuff that matters.
Re:Systemd needs official documentation on best practices by markstos on Friday November 08, 2019 @03:18PM (#21486269)
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.

Re:Systemd needs official documentation on best practices by upofadown on Friday November 08, 2019 @03:33PM (#21486428)
>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.

Re:Systemd needs official documentation on best practices by 1996 on Friday November 08, 2019 @03:40PM (#21486489)
With a non working mail configuration, it goes nowhere.

I think the author meant that

Re:Systemd needs official documentation on best practices by upofadown on Friday November 08, 2019 @03:50PM (#21486584)
If 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...
Re:Systemd needs official documentation on best practices by 1996 on Friday November 08, 2019 @04:40PM (#21487110)
So 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?