all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: 30464@debbugs.gnu.org
Subject: [bug#30464] shepherd logging; console-agetty-service
Date: Sat, 17 Feb 2018 17:20:06 +0100	[thread overview]
Message-ID: <87sh9zk2q1.fsf@gnu.org> (raw)
In-Reply-To: <20180216215725.58607c8c@scratchpost.org> (Danny Milosavljevic's message of "Fri, 16 Feb 2018 21:57:25 +0100")

Hi,

Danny Milosavljevic <dannym@scratchpost.org> skribis:

> On Thu, 15 Feb 2018 16:47:54 +0100
> ludo@gnu.org (Ludovic Courtès) wrote:
>
>> (Which has me thinking that longer term it’d be nice to have the
>> Shepherd take care of syslogd-ish activity.)
>
> If you mean that we should make sure to log shepherd's own messages, I agree.

That’s already done.

> Integrating syslogd into shepherd, not sure.  I think external syslogd is fine.
> If not, there are a lot of other logging programs to choose from.
> I like modularity.

Yes, I like it too.  OTOH, there’s a chicken-and-egg problem here:
shepherd ends up implementing its own logging facility, and we have
situations like the one you mentioned earlier in this thread.

> shepherd could write its messages to the kernel log ringbuffer in /dev/kmsg [3].
> That sounds dirty, but it would synchronize messages oh-so-nicely and would
> not immediately require syslogd.  It would also make sure that syslogd
> eventually picks shepherd's messages up (right now they are somewhere on the
> first terminal - if you are lucky and they didn't scroll off).

Indeed, that’s something we can easily do already, and it would address
a major annoyance.  :-)  Actually, could it use syslog(3), which writes
to /dev/log?

> Also a way of capturing stderr and stdout (and maybe even /dev/log) of services
> would be nice.

Yes.  Though again capturing service stdout/stderr is kinda redundant
with what syslogd does.  What I like in journald is the fact that it
unifies all logging facilities, and also connects them to service
management.

> We could also instead open /dev/klog and dup2 its fd to 1 and 2.
> That way, shepherd messages and all stray messages by any process shepherd
> started will end up in the kernel log.  (problem: there are some reserved
> patterns that have special meaning - and we don't control what the services
> do as well as we do what just shepherd does)

Right, so we’d need shepherd to filter these and pass them through
syslog(3), which ensures correct message formatting.  That’s what
<https://cgit.freedesktop.org/systemd/systemd/tree/src/journal/journald-kmsg.c>
does apparently (thanks for the link!).

> Also, I know one is supposed to write UNIX services as daemons, but that's
> not really composable and kinda complicated to debug for no good reason.
> I'd prefer if shepherd also keeps a way to run regular programs as services,
> making sure that they are session leader, their output is logged, they are
> kept alive and monitored.

Sure!

> daemontools[1][2] have done all this stuff already and I like it much more
> than traditional service managers.  It's much more modular, handles logging
> on its own, handles error cases well, uses the file system well etc, handles
> errors in the loggers (!).

Sounds like a great source of inspiration then.  :-)

>> How about adding a ‘dependencies’ field to <agetty-configuration>?  It’d
>> default to the empty list, and could be set to '(syslogd) in this case.
>> 
>> Does that sound too obscure to you, or would it be OK?
>
> Sure, let's do that.
>
> It's a little weird to have it for all agettys, although maybe some other users
> of agetty require it anyway.
>
> Then I wonder if all guix shepherd service configs should have such a field.

That brings us to the topic of a general service customization
mechanism: <https://bugs.gnu.org/27155>.  Well, one thing at a time.
:-)

Thanks for the great ideas!

Ludo’.

  parent reply	other threads:[~2018-02-17 16:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-15 11:42 [bug#30464] [PATCH 0/2] Add console-agetty-service Danny Milosavljevic
2018-02-15 11:47 ` [bug#30464] [PATCH 1/2] services: " Danny Milosavljevic
2018-02-15 11:47   ` [bug#30464] [PATCH 2/2] services: agetty-shepherd-service: Default to providing 'term-console instead of 'term-auto Danny Milosavljevic
2018-02-15 14:40   ` [bug#30464] [PATCH 1/2] services: Add console-agetty-service Ludovic Courtès
2018-02-15 15:41     ` Danny Milosavljevic
2018-02-15 15:47       ` Ludovic Courtès
2018-02-16 20:57         ` [bug#30464] shepherd logging; console-agetty-service Danny Milosavljevic
2018-02-16 21:07           ` [bug#30464] shepherd logging Danny Milosavljevic
2018-02-16 23:17             ` Danny Milosavljevic
2018-02-17 16:25             ` [bug#30464] " Ludovic Courtès
2018-02-17 16:47               ` Danny Milosavljevic
2018-02-17 16:57                 ` Ludovic Courtès
2018-02-17 16:20           ` Ludovic Courtès [this message]
2018-02-17 18:02             ` shepherd logging; console-agetty-service Danny Milosavljevic
2018-02-26 17:52         ` [bug#30464] [PATCH 1/2] services: Add console-agetty-service Ludovic Courtès
2020-10-08 18:21           ` Maxim Cournoyer
2022-01-13 16:02             ` [bug#30464] [PATCH 0/2] " zimoun
2022-02-03  2:33               ` zimoun
2022-02-03 20:55                 ` Danny Milosavljevic
2022-03-23 13:00                   ` zimoun

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sh9zk2q1.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=30464@debbugs.gnu.org \
    --cc=dannym@scratchpost.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.