[systemd-devel] Startup single step

Lennart Poettering lennart at poettering.net
Wed Jul 3 11:23:18 UTC 2019


On Di, 02.07.19 12:30, Jay Burger (jay.burger at us.fujitsu.com) wrote:

> Hi,
>
> I am curious if there is a way to single step through the systemd startup
> of services?

So this exists, in theory in systemd.confirm_spawn= on the kernel
cmdline. But it's not without pitfalls. In particular, some distros
like to forcibly bind some service's stdio to the tty, which then
interferes with the asking the user stuff. More importantly though,
systemd implements a parallel boot, and a boot that cannot necessarily
be linearized (for exampe: a service X that connects to a service Y
via socket activation or bus activation necessarily means that X' and
Y' start-up need to happen in parallel), and this makes the the
interactive boot-up quite complicated to follow. Moreover lots of
software tends to apply timeouts to stuff (including systemd), and if
we interactively ask the user each time for everything these time-puts
are hit easily. For example dbus clients generally wait for 45s at
most for connection attempts and method calls, and since things add up
these are hit quickly.

hence, yes you can do this, but it's not particular fun, and falls
apart quickly on complex systems, as such interactive boot-ups tend to
behave quite differently from regular ones.

Usually it's better to just turn on debug logging, and try to figure
out things from the logs, when they happen in the same (non-)order and
(rougly) the same timing behaviour as the regular boots.

> I don't find any such feature and am curious what others would think
> of it. We had a similar feature in a previous life, different OS,
> and developers seemed to like it. I personally think it was a handy
> tool to have in the arsenal, probably not a "use it all the time"
> kind of thing.
>
> It could be triggered via a kernel command line option and in it's
> simplest form, systemd would start a service and prompt the user
> before continuing to the next. I know this would change timing and
> dependencies may have issues but just throwing out the idea.
>
> This could possibly even be used to single step through the shutdown
> of services.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list