[systemd-devel] Regarding the

Lennart Poettering lennart at poettering.net
Thu Sep 26 11:46:29 PDT 2013


On Thu, 26.09.13 18:28, abhishek sharma (abhishek.sharma81 at gmail.com) wrote:

> Hi All,
> 
> I am new to Systemd, Need help about understanding some of features of the
> systemd.
> I am interested in knowing the failure of a service and the exact cause of
> it.
> 
> Inside the systemd unit file there are options like SuccessExitStatus and
> On-failure. In SuccessExitStatus we can specify the signals which when
> received will be considered as the the successful exit. my question is
> 
> 1. Any other signal than the ones mentioned in SuccessExitStatus would be
> considered as the failure(on-failure)?

Nope. SIGINT, SIGTERM, SIGHUP, SIGPIPE are never considerd failures, as
they generally indicate clean or user triggered termination.

> 2. How can we get the exact signal from on-failure?

Use the bus API, it's all exported.

http://www.freedesktop.org/wiki/Software/systemd/dbus/

See the documentation for ExecStartPre, ExecStart, ExecStartPost,
ExecReload, ExecStop, ExecStop, ExecMainCode and ExecMainStatus under
"Service Unit Objects".

> 2. Rather than Restart = on-failure, can we use something like
> on-failure = xyz.service

There's OnFailure= for this. See systemd.unit(5).

> 3. Is there any Dbus interface exposed by systemd which can be used to get
> the information like service with unusual exit and the corresponding
> signal?

Yes, (see above).

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list