Re: [systemd-devel] Antw: Re: Antw: Re: Antw: Re: Arbitrary restrictions (e.g. for RuntimeDirectory)

2019-05-15 Thread Lennart Poettering
On Mi, 15.05.19 07:48, Ulrich Windl (ulrich.wi...@rz.uni-regensburg.de) wrote:

> >> Or more like this (in the user directory):?
> >> > systemd‑analyze verify systemd/iotwatch.target.in
> >> Failed to open /dev/tty0: Permission denied
> >> Failed to load systemd/iotwatch.target.in: Invalid argument
> >
> > That's not a valid unit file name. On systemd unit files are named in
> > a very strict fashion, and this is documented. A service unit file
> > name must be suffixed with ".service" and a target unit file name must
> > be suffixed with ".target". The suffix ".target.in" is not valid for a
> > unit file.
>
> So the type to check is deduced from the name? my "target.in" is the template
> used by the generator to create the real target

Yes, the unit type is derived from the unit file name. If a unit file
name ends in ".service" it means it may have a [Service] section in
it, with an ExecStart= line. otoh if it ends in ".mount" it instead
may have [Mount] section with an Option= line.

> Usually I wouldn't associate "Inavalid argument" with "syntax error". I'd
> prefer "unknown suffix" over "Invalid argument". There's less room for
> speculation then...

Please file an RFE issue, or even better prepare a patch!

Lennart

--
Lennart Poettering, Berlin
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

[systemd-devel] Antw: Re: Antw: Re: Antw: Re: Arbitrary restrictions (e.g. for RuntimeDirectory)

2019-05-14 Thread Ulrich Windl
>>> Lennart Poettering  schrieb am 14.05.2019 um 16:15
in
Nachricht <20190514141520.GA22136@gardel-login>:
> On Di, 14.05.19 16:07, Ulrich Windl (ulrich.wi...@rz.uni‑regensburg.de)
wrote:
> 
>> Hmm, like this:?
>> > systemd‑analyze verify /run/systemd/generator.late/iotwatch.target
>> Failed to open /dev/tty0: Permission denied
> 
> This is mostly a cosmetical message you can safely ignore. Moreover this has

> long been fixed and is
> not displayed on any current systemd version.
> 
>> Or more like this (in the user directory):?
>> > systemd‑analyze verify systemd/iotwatch.target.in
>> Failed to open /dev/tty0: Permission denied
>> Failed to load systemd/iotwatch.target.in: Invalid argument
> 
> That's not a valid unit file name. On systemd unit files are named in
> a very strict fashion, and this is documented. A service unit file
> name must be suffixed with ".service" and a target unit file name must
> be suffixed with ".target". The suffix ".target.in" is not valid for a
> unit file.

So the type to check is deduced from the name? my "target.in" is the template
used by the generator to create the real target
Usually I wouldn't associate "Inavalid argument" with "syntax error". I'd
prefer "unknown suffix" over "Invalid argument". There's less room for
speculation then...

> 
> Yes, the error message could be better.

+1 ;-)

> 
> Lennart
> 
> ‑‑
> Lennart Poettering, Berlin



___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel