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...
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.