unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: Robert Vollmert <rob@vllmrt.net>
Cc: guix-devel@gnu.org
Subject: Re: where to put helper to send stdout/stderr to syslog?
Date: Mon, 17 Jun 2019 14:45:49 +0200	[thread overview]
Message-ID: <20190617144549.3430003f@scratchpost.org> (raw)
In-Reply-To: <C799D06C-679A-4333-BA08-FD77C6BF3E43@vllmrt.net>

[-- Attachment #1: Type: text/plain, Size: 1380 bytes --]

Hi Robert,

hmm, I like it in principle.

But doesn't shepherd already log to /dev/kmsg and/or /dev/log (so that ends up
in syslog)?  Since exec-command&co keep the standard output and standard error,
they (and thus all shepherd services) should also already log to the
aforementioned syslog by default.

What is the use case you envision?

> Would logger-wrapper be generally useful to have available? If so,
> is it named well, and where would it fit?

I think it could be made part of shepherd and be exported there, then everyone
could use it.  Logging to syslog isn't exactly an obscure requirement :)

Although shepherd already has its own /dev/log (syslog) client implementation,
the external "logger" executable (or similar) is still necessary, because
/dev/log is a UNIX domain socket and one can't write to UNIX domain sockets
the same way one does pipes.  Although it might be possible (and not
advisable) to connect() the socket and then dup it to 1 and 2 for the child :P

P. S. The way you invoke logger (without full path or gexp package reference)
it will pick up a random logger implementation.  I'm surprised that it works
at all that way.

P. S. Your implementation has shell injection because "name" could contain
spaces and/or semicolons.  I suggest not to use the shell command string but
rather passing logger's argv directly.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-06-17 12:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-16 12:22 where to put helper to send stdout/stderr to syslog? Robert Vollmert
2019-06-17 12:45 ` Danny Milosavljevic [this message]
2019-06-17 13:12   ` Robert Vollmert
2019-06-17 14:45     ` Danny Milosavljevic
2019-06-18 13:32   ` Ludovic Courtès
2019-06-18 16:44     ` Robert Vollmert

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=20190617144549.3430003f@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=guix-devel@gnu.org \
    --cc=rob@vllmrt.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).