[systemd-devel] Boot ordering

Christoph Pleger Christoph.Pleger at cs.tu-dortmund.de
Wed Mar 18 09:10:11 PDT 2015


I am experimenting a little with systemd and trying to define a new
"intermediate" runlevel, a runlevel between basic.target and
multi-user.target. This means that I want the services which are required
by my new runlevel to be started after all services from basic.target have
been started and to be finished before any service from multi-user.target
is started.

So far, I created /lib/systemd/test.target with

Description=Test target
Conflicts=rescue.service rescue.target
After=basic.target rescue.service rescue.target

and /lib/systemd/test.service with

Description=Test service



/usr/local/bin/test is a simple script which just echoes some words on the
display and then sleeps for some minutes.

In /lib/systemd/system/multi-user.target, in lines "Requires=" and
"After=", I replaced basic.target with test.target .

Then I called 'systemctl enable linf.service' and rebooted. The result was
that the computer booted up to the graphical login screen much before the
time I had put in the sleep command of my test script. I logged in from a
remote machine by ssh and used ps to find out if there was a running sleep
command from my script, and there was. So, obviously my script was
executed during the boot phase, but not in the intended order after
basic.target and before multi-user.target.

Why does systemd not follow the above instructions to start the services
of test.target after those of basic.target and before those of


More information about the systemd-devel mailing list