On Mon, Nov 25, 2019 at 3:13 PM Jörg Weinhardt <j...@ib-weinhardt.de> wrote:
> Hi, > > the behavior of systemd is not quite clear to me: > I have a service which requires another service to be started and running, > so I use a Requires= dependency to the required service. > But if the required service does not exist at all, there is no error > message from systemd. > e.g. > > Requires=xyz.service > > produces no complaint and starts the service even if there is no > xyz.service > Is this the normal behavior or can I configure systemd to throw an error > in this case? > The docs say you can get this behavior if you also have After=xyz.service. (Not entirely sure why.) > > If I write > "Requires=xyz" > > there will be a message: Failed to add dependency on xyz, ignoring: > Invalid argument > Does that error mean that "xyz" is not a valid unit name? > It's not a valid unit name if it doesn't have a ".type" suffix. `systemctl start xyz` will just auto-expand it to xyz.service or something that makes sense for systemctl, but systemd's configuration files do not accept such shortcuts. -- Mantas Mikulėnas
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel