From: "Ludovic Courtès" <ludo@gnu.org>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: Guix Devel <guix-devel@gnu.org>
Subject: Re: shepherd: prefix output with service names?
Date: Thu, 15 Dec 2022 16:04:56 +0100 [thread overview]
Message-ID: <871qp0ogh3.fsf@gnu.org> (raw)
In-Reply-To: <87tu1ytgdq.fsf@elephly.net> (Ricardo Wurmus's message of "Wed, 14 Dec 2022 11:38:10 +0100")
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’.
prev parent reply other threads:[~2022-12-15 15:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-14 10:38 shepherd: prefix output with service names? Ricardo Wurmus
2022-12-14 13:51 ` Thompson, David
2022-12-14 14:18 ` Attila Lendvai
2022-12-15 3:47 ` Maxim Cournoyer
2022-12-15 15:04 ` Ludovic Courtès [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871qp0ogh3.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=guix-devel@gnu.org \
--cc=rekado@elephly.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).