On Tue, 2013-05-21 at 15:30 +0200, Zbigniew Jędrzejewski-Szmek wrote:
On Sun, May 19, 2013 at 03:45:48PM +0200, Michael Tremer wrote:
Hello guys,
in this mail, you will find a patch which resolves the problem, that 'systemctl is-enabled' does not work for templated units.
Applied!
Thanks.
See also https://bugs.freedesktop.org/show_bug.cgi?id=55318 for reference.
Without this patch, systemctl is-enabled something@abc.service returned "No such file or directory", because it was checked if /usr/lib/systemd/system/something@abc.service, etc. existed, which is obviously not the case.
Actually, we can mask instance units, so "obviously" is not true. And we can also "concretize" instance units by adding a normal unit file for the instance. I tweaked your patch to just ignore ENOENT for instance units, but perform the checks.
Okay.
If systemctl is-enabled is called for templated units, this check should be omitted and it should be searched for symlinks in the /etc paths right away.
Actually links can appear not just in /etc, so this part of the description is misleading.
I just wrote /etc to keep the message short. It should have been more precise, indeed.
Thanks anyway for looking into that and amending the patch.
-Michael