[systemd-devel] is-enabled and generated units

Igor Bukanov igor at mir2.org
Sun Jun 14 03:11:22 PDT 2015


The reason for .d + .conf, not .wants, is that in my case .conf file
contains several Wants directives including one for a service that is
installed but not not enabled by default. As I do not know the
location of that service unit file (depending on OS or installation it
can be under /usr/lib, /usr/lib64, /etc/ /run/), I use the .conf
fragment as there the Wants does not require to specify an absolute
path.

On 14 June 2015 at 11:52, Michael Biebl <mbiebl at gmail.com> wrote:
> 2015-06-14 11:17 GMT+02:00 Igor Bukanov <igor at mir2.org>:
>> Hello,
>>
>> I noticed that running `systemctl is-enabled foo.service` against a
>> service written by a generator fails with a puzzling error message:
>>
>> Failed to get unit file state for foo.service: No such file or directory
>>
>> when I expected that the command succeeds and prints enabled-runtime
>> as the unit was enabled through a target file
>> /run/systemd/generator/multi-user.target.d/foo.conf containing:
>>
>> [Unit]
>> Wants=foo.service
>
> Just curious: why don't you use
>
>  /run/systemd/generator/multi-user.target.wants/foo.service → symlink
> to the generated file foo.service?
>
> --
> Why is it that all of the instruments seeking intelligent life in the
> universe are pointed away from Earth?


More information about the systemd-devel mailing list