guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [V2 PATCH 1/1] services: Add agetty service.


From: Leo Famulari
Subject: Re: [V2 PATCH 1/1] services: Add agetty service.
Date: Fri, 17 Feb 2017 09:24:24 -0500
User-agent: Mutt/1.7.2 (2016-11-26)

On Fri, Feb 17, 2017 at 08:48:28AM +0100, Ricardo Wurmus wrote:
> Leo Famulari <address@hidden> writes:
> > Is this the right way? Or would we rather wrap only the most
> > commonly-used options, and leave an "escape hatch" as in the first
> > version of the patch? If so, which options should we expose in Scheme?
> 
> That’s hard to say.  I like to *always* keep an escape hatch, which is
> useful in case we are too slow to adapt our code to changes introduced
> by new versions.  In my opinion this version of the patch is better
> because it exposes more values; it would be even better if it added a
> general purpose escape hatch.

Okay.

> Okay.  (Can we generate documentation for the individual fields somehow?)

Well, I'd really like that! IMO, the service that exposes most of
agetty's options can be fully understood by reading the agetty(8) man
page. I don't look forward to paraphrasing agetty(8).

> Some naive comments follow.

It's okay, my implementation is a naive copy-and-extend of the mingetty
service :)

[...]

> > +                          #$@(if remote?
> > +                                 #~("--remote")
> > +                                 #~())
> 
> Looking at all the syntactic noise makes me long for some prettier
> abstraction here, but I can’t think of anything that would make this
> considerably prettier.  Oh well… ¯\_(ツ)_/¯

Agreed but, on the other hand, this is the level of abstraction that I
understand. So, maybe that's a good thing for other Scheme newbies.

> Maybe add a FIXME here, so we can more easily find it.  It might also be
> worth opening a bug report after merging this, so that we can track it.

Okay.

> 
> > +                          #$@(if no-newline?
> > +                                 #~("--nonewline")
> > +                                 #~())
> 
> I’m sure this will trip me up in the future.  “nonewline” vs
> “no-newline” – I prefer your choice, but the double negative is tough
> for me…

I tried to copy the upstream configuration options but make them
"Scheme-y" stylistically.

> > +                          #$@(if no-hostname?
> > +                                 #~("--nohostname")
> > +                                 #~())
> > +                          #$@(if long-hostname?
> > +                                 #~("--long-hostname")
> > +                                 #~())
> 
> Should we try to prevent nonsensical combinations of options?
> Would it just be more confusing to merge “no-hostname?” and “long-hostname?” 
> as
> “print-hostname 'none 'long 'short”?

Sure... volunteers welcome :) 

It was suggested in the past to reimplement mingetty in Scheme (it's
~400 lines of C). That's a case where we can really understand and
control how the program is used. But for this case, we'd need an agetty
expert.

We could also add an activation phase that creates device nodes beyond
ttyS0, because only ttyS0 is created on GuixSD currently. Either that or
limit this service to ttyS0, instead of leaving the choice to the user.
That's something that I will try to do.

Thanks for your review!

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]