Determine when restart fails

James Hunt james.hunt at ubuntu.com
Wed Mar 5 14:51:24 UTC 2014


Hi Michael,

2014-03-04 19:26 GMT+00:00 Michael Barrett <loki77 at gmail.com>:

> Is there anyway to tell the difference between these different 'stopped'
> situations:
> - The daemon was stopped by a user command (service <daemon> stop)
>
$UPSTART_EVENTS will not be set in this scenario (since no event caused the
job to stop - an admin intervened).

- The daemon died, but is has not reached the respawn limit and is
> restarting.
>
  In this scenario, $PROCESS will be set to the name of the job process
that failed (for example 'pre-start', 'main').

- The daemon died and is not going to attempt to respawn due to whatever
> reason (no respawn, or reaching the respawn limit)
>
 In this scenario, if the respawn stanzas was specified, $PROCESS will be
set to 'respawn' to denote that the respawn limit was reached.

If the respawn stanza was not specified, $PROCESS will not be set. However,
in both scenarios upstart will set $EXIT_STATUS or $EXIT_SIGNAL (whichever
is appropriate).

See stopped(7) and init(5) for further details.


> Thanks!
>
> --
> Michael Barrett
>
> --
> upstart-devel mailing list
> upstart-devel at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/upstart-devel
>
>


-- 
Kind regards,

James.
--
James Hunt
____________________________________
#upstart on freenode
http://upstart.ubuntu.com/cookbook
https://lists.ubuntu.com/mailman/listinfo/upstart-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/upstart-devel/attachments/20140305/dfbb21a1/attachment.html>


More information about the upstart-devel mailing list