Subject: Re: [PATCH v6 1/3] services: greetd: Improve greeter configurations.

From: Maxim Cournoyer <[email-masked]>
Date: Fri, 07 Feb 2025 17:27:39 +0900

Hello,

muradm <[email-masked]> writes:

> Hello,
>
>>> +@item @code{extra-shepherd-requirement} (default: @code{'()})
>>> +This option can be used to provide a list of additional 
>>> symbols naming Shepherd
>>> +services that this service will depend on, such as 
>>> @code{'seatd} or
>>> +@code{'elogind} when terminal session is graphical greeter.
>>
>> Neat!  According to git-grep, the most common name for this 
>> field is
>> 'shepherd-requirement', followed by 'shepherd-requirements'.  I 
>> think we
>> should standardize on the former (shepherd-requirement), as this 
>> gets
>> passed as the 'requirement' field value of the underlying
>> `shepherd-service' record.

> I explicitly named field 'extra-shepherd-requirement' due to its 
> implementation. Other places you mention about configure whole 
> list of requirements, for instance:
>
>   (shepherd-requirement 
>   mingetty-configuration-shepherd-requirement
>                         ;; Since the login prompt shows the host 
>                         name, wait
>                         ;; for the 'host-name' service to be done. 
>                         Also wait
>                         ;; for udev essentially so that the tty 
>                         text is not
>                         ;; lost in the middle of kernel messages 
>                         (XXX).
>                         (default '(user-processes host-name udev
>                                                   virtual-terminal))))
>
>   ;; .... skipped
>
>     (list
>      (shepherd-service
>       (documentation "Run mingetty on an tty.")
>       (provision (list (symbol-append 'term- (string->symbol 
>       tty))))
>
>       (requirement shepherd-requirement)
>
>
> Compared to what 'extra-shepherd-requirement' means:
>
> +  (extra-shepherd-requirement greetd-extra-shepherd-requirement 
> (default '()))
>
> -          (greetd-vt (greetd-terminal-vt tc)))
> +          (greetd-vt (greetd-terminal-vt tc))
> +          (greetd-requirement (greetd-extra-shepherd-requirement 
> tc)))
>         (shepherd-service
>          (documentation "Minimal and flexible login manager 
>          daemon")
> -        (requirement '(pam user-processes host-name udev 
>          virtual-terminal))
> +        (requirement `(pam user-processes host-name udev 
> virtual-terminal
> +                           ,@greetd-requirement))

I see; that makes sense.  Since this is a new field that was added
yesterday, I think it's still time to change it to
extra-shepherd-requirement, if you feel it makes a big enough
difference.

Sorry for not having seen that (I did try to interpret it that way, but
stopped on the default value of '()).

-- 
Thanks,
Maxim