[systemd-devel] Question on Before=

Uoti Urpala uoti.urpala at pp1.inet.fi
Sat Feb 2 21:07:26 UTC 2019


On Sat, 2019-02-02 at 15:03 -0500, Steve Dickson wrote:
> >   Have you enabled a.service?
> > 
> No... I did not think I had to... I figured 
> when b.service was started, a.service would be 
> run regardless of being enabled or disabled.
> 
> Is that not the case?

So you just have the file for a.service lying somewhere on disk, but
haven't enabled it and no other unit references it? That won't do
anything - systemd does not read through all files on disk to see if
there'd be something inside the file which declares that it should
actually be started. Units need to have something else referencing them
for systemd to "see" them at all. "enable" does this by creating a link
from the units/targets referenced in the [Install] section to the file
in question (by creating a symlink in 
/etc/systemd/system/multi-user.target.wants/ for example).




More information about the systemd-devel mailing list