detect service crashes

From: Alex Efros <powerman_at_powerman.name>
Date: Fri, 6 Sep 2013 17:04:42 +0300

Hi!

I've configured notification when service crash in ./finish:

    tail ./log/current | mail "$USER" -s "service exit: $(basename "$(pwd)")"

I'm using this in many of our custom services, and it's very useful.
But I'm also receiving a lot of useless emails every time server rebooted
or services restarted manually.

Is it possible to somehow detect in ./finish script is it was called
because ./run just exited/crashed on it's own, or because ./run was killed
by `sv t` (manually) or `sv force-stop` (while server shutdown)?

-- 
			WBR, Alex.
Received on Fri Sep 06 2013 - 14:04:42 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:18 UTC