On 2015-10-16 18:30, Andrei Borzenkov wrote:
16.10.2015 17:41, Chris Bell пишет:
[Install]
WantedBy= # To clear out previous wantedby params, though this doesn't seem to work like that. Documentation doesn't say it
should, so I'm not surprised.

Only selected directives can be cleared this way.

Is there a way I can have it only enable the alias of the unit? Or do
both have to be enabled?

The problem is that Alias is just a symlink to "primary" unit file.
But in case of instantiated template no primary unit file exists at
all. So there would really be nothing to link to.

But it seems that even if I create link foo@bar.service to
foo@.service it still wants to enable template, not instantiated unit.

Also, is there any way to specify a unit alias within an override.conf?


Seems to be ignored, at least [Install] section.

So, in short, systemd doesn't provide quite the functionality I am looking for here. I am able to enable only the alias by using:

[Install]
Alias=machines.target.wants/gitlab.service

and not using 'WantedBy.' This achieves part of what I'd like to accomplish. However, it doesn't end up being any more convenient from most points of view. I was hoping that, if I aliased 'systemd-nspawn@gitlab.service' to 'gitlab.service' that I could then use:

# systemctl <command> gitlab.service

and have it know that I'm talking about gitlab.service. And I would really like to be able to do this with overrides. Why? Because I'd like to be able to have conveniently-named service identifiers that point to pre-defined services/templates/etc. I would like to manage 'systemd-nspawn@gitlab.service' as 'gitlab.service' without having to copy the systemd-nspawn template to a brand new gitlab.service. If I create one-off copies, then if the template is updated those changes don't propagate to the one-off copy. I guess I could accomplish this with symlinks in the /etc/systemd dir (gitlab.service -> systemd-nspawn@gitlab.service) but that's not a nice, clean, or good way to do it. Are there any other solutions/workarounds? Or is systemd just not intended to be used like this?

Thanks again!

Chris
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to