[systemd-devel] I want to ask you a fundamental question to you about dependency and starting sequence among units.
grawity at gmail.com
Wed Jul 24 10:25:22 PDT 2013
On Wed, Jul 24, 2013 at 7:15 PM, Tony Seo <tonyseo7 at gmail.com> wrote:
> When I first read a manpage which explains [Unit] option, I find a
> For example, I make a "A.service" which has an "Want = B.service".
> If A.service is started by systemd, I think that B.service will be started
> after A.service is totally completed.
> ( Is it right to use a words "totally completed to explain execution of
> And I'm confused words which explain some parts of "Wants=", I couldn't
> understand the expression "start-up".
> Does it mean that a unit listed in "Want=" option will be started after the
> configuring unit is finished? )
> if so, I think this relationship like below
> 1. B.service is a dependency of A.service.
> 2. A.service is started before B.service is started in sequential
> perspective of boot sequence among units.
> 3. if B.service is in A.service.want folder, a implicit dependency is made
> between A.service and B.service( result will be same as No.1)
#1 and #3 are correct, but #2 is not.
Properties like "Wants=" or "Requires=" only define *dependencies* –
if A has "Wants=B", then starting A will also make systemd try to
start B – but they do not define any sort of *order*.
There is a separate set of properties, "After=" and "Before=", that
specify order, but do not add any dependencies. For example, if A has
"After=B", or if B has "Before=A", then they will be started
sequentially (A will be started after B has started). If order is not
specified, both will be started at the same time.
As for the terms... it seems that the general stages are "inactive",
"activating" (in the startup process), "active" (has finished
startup), and "deactivating". I'm not entirely sure what stages apply
to .service units.
Mantas Mikulėnas <grawity at gmail.com>
More information about the systemd-devel