guix-devel
[Top][All Lists]
Advanced

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

Re: weird errors; shepherd


From: Ludovic Courtès
Subject: Re: weird errors; shepherd
Date: Wed, 24 Jan 2018 23:28:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Danny Milosavljevic <address@hidden> skribis:

> On Wed, 24 Jan 2018 15:47:16 +0100
> address@hidden (Ludovic Courtès) wrote:
>
>> I’m not sure what you mean.  There’s no notion of dependencies among
>> activation snippets, let alone between activation snippets and service
>> starts (when booting, activation snippets run *before* shepherd is
>> started).  Perhaps there’s a misunderstanding here?
>
> Yeah, if it's intended that way, that's fine.  So it's like /etc/rc.local
> and it just runs the snippets in any order?

Yes.

> Now, I just do both the trytond DB-upgrading and the service starting at the
> "start" action because postgres isn't running yet otherwise.

That’s the right thing to do if you need ordering.

>> >   As far as I understand make-forkexec-constructor takes special care not
>> >   to kill stderr.  As long there's no log-file specified it should leave 
>> > stdout
>> >   and stderr alone.  So where does the text go?  
>> 
>> To PID 1’s stdout/stderr, i.e., /dev/console (which sucks).
>
> Really?  I don't see it in the marionette os output (for make check-system) - 

When running “make check-system”, you see the console (which is
redirected to the host’s qemu stdout), like this:

--8<---------------cut here---------------start------------->8---
$ make check-system TESTS=basic

[...]

[    0.511024] Freeing unused kernel memory: 308K
GC Warning: pthread_getattr_np or pthread_attr_getstack failed for main thread
GC Warning: Couldn't read /proc/stat
Welcome, this is GNU's early boot Guile.
Use '--repl' for an initrd REPL.

loading kernel modules...

[...]

adding group 'input'...
adding group 'video'...
adding group 'audio'...
adding group 'netdev'...
adding group 'lp'...
adding group 'disk'...
adding group 'floppy'...

[...]

Service udev has been started.
Service urandom-seed has been started.
Service user-processes has been started.
Service host-name has been started.
Service user-homes could not be started.
nscd: 279 monitoring file `/etc/hosts` (1)
nscd: 279 monitoring directory `/etc` (2)
nscd: 279 monitoring file `/etc/resolv.conf` (3)
nscd: 279 monitoring directory `/etc` (2)
nscd: 279 monitoring file `/etc/services` (4)
nscd: 279 monitoring directory `/etc` (2)
Service nscd has been started.

[...]

Written by Mike Haertel and others, see 
<http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
+ info --version
info (GNU texinfo) 6.3

Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
shepherd: Service user-homes could not be started.
QEMU runs as PID 6
connected to QEMU's monitor
read QEMU monitor prompt
connected to guest REPL
%%%% Starting test basic  (Writing full log to "basic.log")
marionette is ready

;;; (services (user-processes loopback term-tty2 udev console-font-tty2 
term-tty3 term-tty1 console-font-tty6 urandom-seed file-system-/dev/shm 
console-font-tty5 console-font-tty1 guix-daemon host-name file-system-/dev/pts 
user-file-systems root term-tty4 file-systems user-homes root-file-system nscd 
marionette syslogd term-tty6 term-tty5 console-font-tty4 console-font-tty3))
# of expected passes      19
@ build-succeeded /gnu/store/xab6i89lf15rab8ipy78rkj4218dzjvd-basic.drv -
TOTAL: 1
PASS: /gnu/store/hazdppnr6cd1dhqnbjhyj44yb6xcfpnf-basic
--8<---------------cut here---------------end--------------->8---

Here you see the output of ‘useradd’, shepherd itself, nscd, marionette,
etc.  All this is /dev/console.

> Also tried
>                     (marionette-eval '(current-output-port
>                                                  (open-file "/dev/console" 
> "w0"))
>                                                                             
> marionette)
>                     (marionette-eval '(current-error-port
>                                                  (open-file "/dev/console" 
> "w0"))
>                                                                             
> marionette)

This shouldn’t be necessary, but it would change the error port for the
marionette process itself.

>> That’s inconvenient but “expected” in the sense that the ‘start’ method
>> is called right from shepherd.conf.  Perhaps we should call ‘start’ at a
>> later stage.
>
> Well, as it is it makes the system very brittle.
>
> Once one service does that... oops.

Yeah, but then again we test services in a VM beforehand.  :-)
Also, using (error "xxx") is frowned upon because it raises an exception
that cannot usefully be handled.

Ludo’.



reply via email to

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