On Thu, 01.09.11 16:25, Lennart Poettering ([email protected]) wrote: > > On Thu, 01.09.11 13:07, Reindl Harald ([email protected]) wrote: > > > > and at the same time take other action like potentially trigger abrt to > > > send bug report or > > > revert changes and restart the daemon etc. as opposed to pipe a simple > > > mail notification > > > to root and systemd provides exactly that to admins via OnFailure= see > > > man systemd.unit > > > for details... > > > > http://0pointer.de/public/systemd-man/systemd.unit.html does not contain > > the word "mail" > > "RestartNotifyMail=root" would be what is needed in SOHO environments! > > > > well but a) there are missing options and b) OnFailure is simply a joke > > if i say "Restart=always" then OnFailure is NOT triggered > > if this is the case, then this should be considered a bug I > guess. Please file it. > > > if i say "Restart=always" i want a mail if this happens > > not a own unit-file > > write a unit file that sends a mail, something like this: > > [email protected]: > <snip> > [Unit] > Description=Send mail on failure of %I > > [Service] > ExecStart=/path/to/my/script.sh %I > </snip> > > /path/to/my/script.sh: > <snip> > #!/bin/sh > > ( > echo "$1 crashed, do something, sir!" > echo "here's the systemctl status output:" > systemctl status "$1" > ) | mail lennart -s "OMG! PONIES!" > </snip> > > And then add OnFailure=send-mail-on-failure@%P to your units where you > want a mail to be sent.
"OnFailure=send-mail-on-failure@%P.service" I meant. Sorry for the confusion. All untested, but you get the idea... Lennart -- Lennart Poettering - Red Hat, Inc. _______________________________________________ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/systemd-devel
