[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: shepherd: prefix output with service names?
From: |
Ludovic Courtès |
Subject: |
Re: shepherd: prefix output with service names? |
Date: |
Thu, 15 Dec 2022 16:04:56 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Hi!
Ricardo Wurmus <rekado@elephly.net> skribis:
> here is some output from “guix system reconfigure”:
>
> …
> activating system...
> The following derivation will be built:
> /gnu/store/7361cd8aasxwwb93ygdfwjp3ghn06ahb-switch-to-system.scm.drv
>
> building
> /gnu/store/7361cd8aasxwwb93ygdfwjp3ghn06ahb-switch-to-system.scm.drv...
> making '/gnu/store/rp04hkqlzx5j2lhxainsz77vpqqigsjz-system' the current
> system...
> setting up setuid programs in '/run/setuid-programs'...
> populating /etc from /gnu/store/gq2dvz09wf3sdmvynr2vdzy5wwj7k9fd-etc...
> The files belonging to this database system will be owned by user "postgres".
> This user must also own the server process.
>
> The database cluster will be initialized with locale "en_US.utf8".
> The default database encoding has accordingly been set to "UTF8".
> The default text search configuration will be set to "english".
>
> Data page checksums are disabled.
>
> initdb: error: directory "/var/lib/postgresql/data" exists but is not empty
> If you want to create a new database system, either remove or empty
> the directory "/var/lib/postgresql/data" or run initdb
> with an argument other than "/var/lib/postgresql/data".
> Starting installation ...
> Validate installation settings ...
> Create file system structures ...
> Create self-signed certificate database ...
> Error: Instance creation failed! Failed to start DS
These lines are produced by activation snippets; they don’t go through
shepherd.
> You see that there is output of tools that run as part of service
> activation snippets. It is not clear which service is responsible for
> any particular line of output.
>
> What service produced the line “Error: Instance creation failed! Failed
> to start DS”, for example? I know it’s the directory-server-localhost
> service, because that’s what I’m working on right now, but it’s not
> clear from the output.
>
> What do you think of prefixing every line with the name of the service
> that is responsible for it? This way we could probably also
> prettify/post-process the output somewhat.
I agree it would be great; it’s not related to shepherd though (shepherd
already does that).
Now, maybe some activation snippets could be moved to the ‘start’ method
of the corresponding service. That is, instead of:
(make-forkexec-constructor …)
you’d have:
(lambda ()
(invoke …) ;run some initialization command here
(fork+exec-command …))
In some cases that may be more appropriate; as a bonus, it would solve
the logging problem since shepherd would log it correctly.
WDYT?
Ludo’.