[systemd-devel] non-existent unit instances

Kevin P. Fleming kevin at km6g.us
Sat Sep 5 11:18:06 UTC 2020


It's a general issue with templated unit files; I've had this happen
as well, and could not figure out why the service had failed to start.
It was because I had mistyped the instance name. As best I can tell
systemd doesn't have any mechanism to restrict the instance names
which can be used for a specific unit file, so it can't know that the
requested instance cannot be started.

On Sat, Sep 5, 2020 at 2:46 AM Richard Hector <richard at walnut.gen.nz> wrote:
>
> Hi all,
>
> Quoting from another thread:
>
> On 5/09/20 4:36 am, Lennart Poettering wrote:
> > Unit instances can be activated on-the-fly without further prepartion
> > or regsitration of the instance string or so. it's sufficient if the
> > template unit exists.
>
> Is that preventable?
>
> I have some instance names that are easily typoed. When I start one with
> the wrong name, it sticks around trying to restart for ever - or at
> least till I notice it or reboot - where I'm much rather get an error
> message and stop.
>
> For reference, this is with the openvpn-client@ (and maybe
> openvpn-server@) units in Debian buster. Some of the content was
> modified/overwritten by me, so it could well be a bug introduced by me.
>
> The typos are because my instances are based on hostname, which can
> contain '-' but not '_'. Instance names can apparently not contain '-',
> so I have to use '_' instead, but my muscle memory for my hostnames is
> strong.
>
> I don't know if this is a result of the way the units are written, or an
> inherent issue with systemd.
>
> Cheers,
> Richard
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel


More information about the systemd-devel mailing list