[systemd-devel] Systemd of course

Lennart Poettering lennart at poettering.net
Mon Apr 8 05:36:41 PDT 2013


On Sun, 07.04.13 14:30, Pascal (patatetom at gmail.com) wrote:

> Hi,
> 
> 
> I need some help to (even) understand systemd process (philosophy)...
> 
> How, from a service, stop the boot process if an error occurs in this
> service?
> 
> For example, a bash script do a check and return false or true. If true
> returned, all is ok and the boot process go on with default target and
> display-manager.service. If false returned, the "bash script" service stop
> the boot process.

Well, "stopping" the boot process is a bit unspecific. Note that we
generally try to run as much in parallel as we can, which means that
there generally isn't a point in the boot process where you can say "now
stop doing the rest of the boot", because that "rest of the boot" is
already in progress.

So, depending on your specific usecase what you probably want to do is
make a couple of specific services fail. This is what you can do via
"Requires=" from those services back to your service that is the one
that might be failing.

Or, you can tell the system to enter an entirely new mode on failure,
which you can configure via OnFailure= and OnFailureIsolate=.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list