I like to keep my custom unit files in their own directory away from /etc. In 247 this worked well, using something like the following:
systemctl enable /path/to/unit.service
This also worked with templates, even those that had an associated timer:
systemctl enable /path/to/timed-unit@.*
After which you would instantiate:
systemctl enable [email protected]
However in 252 when trying to enable the files using pathnames, I now get the following errors:
Failed to enable unit: Destination unit timers.target is a non-template unit.
or:
Failed to enable unit: Destination unit multi-user.target is a non-template unit.
The docs[1] indicate that if a template lists a service (in this case via WantedBy
s), then it needs a DefaultInstance
or instance provided on enabling. This kind of makes sense, so either the behaviour has been tightened up, or a bug has been fixed in 252.
However providing an instance to the path results in a file not found error (as would be expected). I could probably create the symlinks myself, but is there any way to have systemd register a unit file on the filesystem to be enabled with an instance later?
[1] https://www.freedesktop.org/software/systemd/man/systemd.unit.html#%5BInstall%5D%20Section%20Options