Re: bug#30706: Nginx service fails

2018-03-10 Thread Ludovic Courtès
Heya,

Danny Milosavljevic  skribis:

>> If you run this on an “old” GuixSD, ‘find-long-options’ is undefined.
>
> How can it be that (gnu services base) with find-long-options call is present
> but the (gnu build linux-boot)'s find-long options isn't present?

The service-upgrade code loads new service definitions in PID 1.
However, it does not force a reload of already-loaded modules.

What happens here is that (gnu build linux-boot), the one without
‘find-long-options’, is already available in PID 1.  Thus, when end up
using that one, which lacks ‘find-long-options’.

We could call ‘reload-module’, but that’s probably not a great idea as
it could cause breakage in previously-loaded code in PID 1.  So I think
the current approach is the safest, and breakage of this sort should be
quite rare; we should pay attention to such issues, though, and try hard
to avoid them.

(Note that there’s no problem once you reboot, of course.)

>>   1. ‘guix system reconfigure’ should probably register services one by
>>  one so that if one of the service expressions is erroneous, we
>>  don’t bork everything.  See ‘upgrade-shepherd-services’.
>
> Yes please.
>
>>   2. IWBN to delay execution of this whole default-tty thing to the
>>  #:start method.  Ideas, Danny?
>
> The idea was that if you specify a serial console at boot that you can
> actually log in at that console.
>
> So it's trying to find out whether, at the time of service start,
> there is a serial console specified (in the Linux command line), and if
> so, start an agetty.  Otherwise do not start that agetty.
>
> We could also do that without a guix service - but I thought it would be
> nice to have a guix service for it as well.

I agree.  I think what you did in
c32e3ddedd103318ca3f0a4bf0c91c91e2517806 is good.  The effect here is
just that agetty would fail to start upon reconfigure, but that’s an
acceptable limitation IMO.

Thanks,
Ludo’.



Re: bug#30706: Nginx service fails

2018-03-06 Thread Danny Milosavljevic
Hi Ludo,

> If you run this on an “old” GuixSD, ‘find-long-options’ is undefined.

How can it be that (gnu services base) with find-long-options call is present
but the (gnu build linux-boot)'s find-long options isn't present?

Aren't they either both added by "guix system reconfigure" (or both removed)?

Also when selecting an old generation in the Grub boot menu, isn't both
(gnu build linux-boot) and (gnu services base) at the same generation when
starting up the service (as opposed to stopping the old service)?

>   1. ‘guix system reconfigure’ should probably register services one by
>  one so that if one of the service expressions is erroneous, we
>  don’t bork everything.  See ‘upgrade-shepherd-services’.

Yes please.

>   2. IWBN to delay execution of this whole default-tty thing to the
>  #:start method.  Ideas, Danny?

The idea was that if you specify a serial console at boot that you can
actually log in at that console.

So it's trying to find out whether, at the time of service start,
there is a serial console specified (in the Linux command line), and if
so, start an agetty.  Otherwise do not start that agetty.

We could also do that without a guix service - but I thought it would be
nice to have a guix service for it as well.


pgpVayyTcm95X.pgp
Description: OpenPGP digital signature


Re: bug#30706: Nginx service fails

2018-03-05 Thread Ludovic Courtès
Andreas Enge  skribis:

> guix system: loading new services: user-homes term-auto nginx...
> shepherd: Evaluating user expression (register-services (primitive-load 
> "/gnu/st?") ?).
> guix system: error: exception caught while executing 'eval' on service 'root':
> find-long-options: unbound variable

The problem we have here is that the agetty service expects
‘find-long-options’ from linux-boot.scm, and it expects it at the top
level.

So what happens above is that we evaluate in PID 1 code like:

  (make 
;; …
#:start (let ((tty … (find-long-options …) …))
   …))

If you run this on an “old” GuixSD, ‘find-long-options’ is undefined.

Thus the whole (register-services …) expression fails to evaluate, and
we end up with some of the services missing.

Conclusions:

  1. ‘guix system reconfigure’ should probably register services one by
 one so that if one of the service expressions is erroneous, we
 don’t bork everything.  See ‘upgrade-shepherd-services’.

  2. IWBN to delay execution of this whole default-tty thing to the
 #:start method.  Ideas, Danny?

In general we should do as little as possible at the top level in the
Shepherd config file.

Ludo’.



Re: bug#30706: Nginx service fails

2018-03-04 Thread Andreas Enge
On Mon, Mar 05, 2018 at 08:23:18AM +0100, Ricardo Wurmus wrote:
> I had the same error when updating my i686 netbook after a long while.
> After a reboot everything seemed to be fine, though.

Ah, thanks for the information! A reboot made things worse in my case -
I rebooted the virtual machine, and now I cannot ssh into it any more.
So it looks like I will have to set it up from scratch again...

In my case, the problem occurred between February 28 and March 4.

Andreas




Re: bug#30706: Nginx service fails

2018-03-04 Thread Ricardo Wurmus

Andreas Enge  writes:

> Well, I am turning this into a bug report, since it still occurs with
> the latest git commit ac1a9ce8b07f3b80900ee08436ff6e683e8dc195 .
>
> This is the result of "./pre-inst-env guix system reconfigure ...",
> where "..." is my configuration file:
>
> ...
> creating nginx log directory '/var/log/nginx'
> creating nginx run directory '/var/run/nginx'
> creating nginx temp directories 
> '/var/run/nginx/{client_body,proxy,fastcgi,uwsgi,scgi}_temp'
> nginx: [alert] could not open error log file: open() 
> "/gnu/store/pp71iff1qxwhh82vm34g18h9kmn0xrg5-nginx-1.13.9/logs/error.log" 
> failed (2: No such file or directory)
> nginx: the configuration file 
> /gnu/store/5ixkryw6jl32cm6d1g9jb8dm9rbz8csc-nginx.conf syntax is ok
> nginx: configuration file 
> /gnu/store/5ixkryw6jl32cm6d1g9jb8dm9rbz8csc-nginx.conf test is successful
> `/gnu/store/zchh8s3r1bbmia3zfxsyhsz3c4b9fmps-openssh-authorized-keys/root' -> 
> `/etc/ssh/authorized_keys.d/root'
> `/gnu/store/zchh8s3r1bbmia3zfxsyhsz3c4b9fmps-openssh-authorized-keys/andreas' 
> -> `/etc/ssh/authorized_keys.d/andreas'
> guix system: loading new services: user-homes term-auto nginx...
> shepherd: Evaluating user expression (register-services (primitive-load 
> "/gnu/st?") ?).
> guix system: error: exception caught while executing 'eval' on service 'root':
> find-long-options: unbound variable

I had the same error when updating my i686 netbook after a long while.
After a reboot everything seemed to be fine, though.

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net