I have two services, A and B, installed by two different packages.
Service B depends on service A.
Both are disabled and stopped by default.
In order to get service B running on each boot, I enable it, then I start it:
systemctl enable B
systemctl start B
Since B depends on A, I expect A to be started, and it does get started! Yet A is not enabled. Is that an expected behavior? It kind of looks weird to me, somehow.
Yes, it is the expected behavior.
The systemctl enable
and systemctl disable
operations configure auto-starting of a unit.
More precisely, these operations simply perform what is described in the [Install]
section of a unit file (or an inverse of these actions). Most of the times, this includes adding an artificial dependency to the unit from multi-user.target
or a similar system-wide target, and nothing more.
Hence, starting the unit manually or via other dependencies is completely unaffected by this. If you really want to prevent starting the unit file, either manually or via a dependency, run systemctl mask UNIT
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With