[systemd-devel] Can I enable/disable a target?

Michael Biebl mbiebl at gmail.com
Thu May 9 11:42:10 UTC 2019


[Please do not send this message to me privately only]

Am Do., 9. Mai 2019 um 13:22 Uhr schrieb Ulrich Windl
<Ulrich.Windl at rz.uni-regensburg.de>:
>
> >>> Michael Biebl <mbiebl at gmail.com> schrieb am 09.05.2019 um 12:29 in
> Nachricht
> <CAGWsdOjaT+g+-f2EJGH5SqgdH0p1mTTriKRdPov7eSD8aJwjOQ at mail.gmail.com>:
> > Am Do., 9. Mai 2019 um 12:27 Uhr schrieb Ulrich Windl
> > <Ulrich.Windl at rz.uni-regensburg.de>:
> >>
> >> Hi!
> >>
> >> Whenever I try to enable or disable a target (that exists), I get "Failed
> to
> > execute operation: No such file or directory". What file or directory,
> > please? Or what is the command trying to say?
> >
> > Can you share the target unit please.
> > Into what location have you installed the unit file?
>
> Good question: I should have been created by a generator, so the location
> should be /run/systemd/generator*, but I could not find it. I have the feeling
> that "systemctl daemon-reload" did not trigger the generator (which is at
> /usr/lib/systemd/system-generators/iotwatch-generator).
>
> OK, trying to run the generator manually I found that it exits with 1, not
> creating the target. Wouldn't it be nice if systemd would log failed
> generators?

It does. You can find the log message in the journal.
See my other email

> So I fixed the generator (it can still exit with 1, but no longer in the
> success-case).
>
> Now I have some "bad" state:
> # systemctl status iotwatch.target
>  ● iotwatch.target - iotwatch I/O performance monitor
>    Loaded: loaded (/run/systemd/generator.late/iotwatch.target; bad; vendor
> preset: disabled)
>    Active: inactive (dead) since Thu 2019-05-09 12:39:45 CEST; 39min ago
> ...
>
> What is that "bad" referring to? The target
> /run/systemd/generator.late/iotwatch.target looks like this:
> # cat /run/systemd/generator.late/iotwatch.target
> [Unit]
> Description=iotwatch I/O performance monitor
> Documentation=man:iotwatch at .service(8) man:iotwatch-generator(8)
> After=nss-lookup.target time-sync.target paths.target
> Wants=iotwatch at VAR.service
>
> [Install]
> WantedBy=multi-user.target



-- 
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