[systemd-devel] Using `systemctl edit` on "invalid" unit names
Ronny Chevalier
chevalier.ronny at gmail.com
Sat Dec 13 06:34:01 PST 2014
2014-12-13 11:33 GMT+01:00 Ivan Shapovalov <intelfx100 at gmail.com>:
> Hello all,
Hi,
>
> it seems that the newly added `systemctl edit` command requires its arguments
> to be valid unit names.
>
> This causes `edit` operation to fail in apparently valid use-cases like
>
> systemctl edit getty at .service
This is fixed in git now, thanks!
> or
> systemctl edit autovt at tty1.service
>
> In second case, the error message is especially cryptic:
> "autovt at tty1.service ignored: not found".
It worked before and it still works for me.
>
> Actually I understand what it does mean: systemctl asks the manager to show
> unit's FragmentPath -> the manager tries to load the unit -> loading fails with
> "File exists" because getty at tty1.service is already instantiated.
I don't see why it should fail for this reason ?
>
> (BTW, it's a separate question: is this failure valid or is it a bug?)
>
systemctl edit getty at .service, should have worked before so yes this was a bug.
> But well. I guess that `edit` operation should always work with unit files
> directly, just like enable/disable commands do.
systemctl edit try to use the bus if it is possible, because this is
the only way you can know where is the unit file of the unit
foo.service currently running. Is it in /etc/systemd or
/usr/lib/systemd? If we check directly the file system we will assume
this is the first directory with the highest priority, which is wrong
in some cases.
But systemctl edit wanted to work with valid unit names which is wrong
in some cases too, so this is fixed now.
>
> Is this all correct? Can anyone please comment on these two issues?
Thanks for the report!
>
> --
> Ivan Shapovalov / intelfx /
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
More information about the systemd-devel
mailing list