From: ludo@gnu.org (Ludovic Courtès)
To: David Craven <david@craven.ch>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Shepherd redirect stdout/stderr to syslog
Date: Mon, 05 Sep 2016 23:14:08 +0200 [thread overview]
Message-ID: <878tv6uk0v.fsf@gnu.org> (raw)
In-Reply-To: <CAL1_immoRNBh9OL2eN5sLN9c_w8NfiK5NTdAkG6VUgtTmspVSw@mail.gmail.com> (David Craven's message of "Mon, 5 Sep 2016 15:44:40 +0200")
David Craven <david@craven.ch> skribis:
>> Is redirecting stdout/stderr to syslog something that
>> make-forkexec-constructor could/should do?
>
> I looked into what would be involved. I included a diff that I didn't
> test and don't expect to work.
>
> The reason why I don't expect this to work is that running echo
> "hello" > /dev/log errors. stracing logger "hello" shows that it makes
> use of the socket and sendmsg syscalls instead of the usual open and
> write syscalls. I don't understand why though, since what's the point
> of everything being a file if they don't share the same interface?
The important thing is the special format, which includes the date:
sendto(3, "<13>Sep 5 23:09:51 ludo: foo", 29, 0, NULL, 0) = 29
misc/syslog.c:193 in glibc implements this.
So we would need to pipe each daemon’s stdout/stderr to the Shepherd
itself, which would select(2) on all these, prepend the right prefix,
and write that to /dev/log, I think.
Ludo’.
next prev parent reply other threads:[~2016-09-05 21:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-04 11:26 Shepherd redirect stdout/stderr to syslog David Craven
2016-09-05 13:44 ` David Craven
2016-09-05 21:14 ` Ludovic Courtès [this message]
2016-09-06 12:35 ` [PATCH] service: Honor #:log-file in make-forkexec-constructor David Craven
2016-09-06 12:36 ` David Craven
2016-09-06 19:13 ` Danny Milosavljevic
2016-09-06 20:02 ` David Craven
2016-09-11 13:34 ` Ludovic Courtès
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=878tv6uk0v.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=david@craven.ch \
--cc=guix-devel@gnu.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.