[systemd-devel] Enabling template units
Colin Guthrie
gmane at colin.guthr.ie
Thu Jan 19 05:13:17 PST 2012
Hi,
Previously I've asked why "systemctl enable dm.service" results in a
(cryptic) error:
Failed to issue method call: No such file or directory
While that is something I ultimately intend to fix (i.e. give a clearer
error message) this is the expected behaviour as dm.service is really an
alias for prefdm.service which is what I should have used in my command.
Anyway, I accept this behaviour and find it sensible enough given the
reasons Lennart gave previously.
However, I now find myself in a somewhat related situation...
I have just written a simply template unit for memcached (I run multiple
memcache daemons on my development systems). I had previously (years
ago?) hacked up memcached sysvinit script which supported starting
multiple instances of memcached and all was well. When looking at this
from a systemd perspective it's clear I want to use the template units
to do the same job.
However, if I do: "systemctl enable memcached at default.service" I get the
same error as above.
Do you agree that when calling this command it should work and enable
things as needed? It would obviously mean supporting %i/%I in the
[Install] section's Alias option, but that may actually already be the
case anyway and is likely fairly trivial if not.
Other than that I do not see a specific problem with this approach.
Doing the symlinks by hand seems a little bit silly as it means manually
looking at the unit's [Install] section to see if there is a WantedBy=
argument such that you can symlink it in the right .wants folder. All in
all it seems something that should be wrapped up.
WDYT?
Col
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited http://www.tribalogic.net/
Open Source:
Mageia Contributor http://www.mageia.org/
PulseAudio Hacker http://www.pulseaudio.org/
Trac Hacker http://trac.edgewall.org/
More information about the systemd-devel
mailing list