unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Vollmert <rob@vllmrt.net>
To: 30939@debbugs.gnu.org
Subject: bug#30939: still relevant
Date: Wed, 26 Jun 2019 20:07:06 +0200	[thread overview]
Message-ID: <FABCF7A5-CE74-478C-B581-D3142FECD545@vllmrt.net> (raw)
In-Reply-To: <20180325183555.cilo6qyrj43jh6he@abyayala>

This came up again recently, compare the discussion here:

https://lists.gnu.org/archive/html/guix-devel/2019-06/msg00186.html

Here’s some code to wrap an executable manually to capture its output
and send it to syslog:

(define* (logger-wrapper name exec . args)
  "Return a derivation that builds a script to start a process with
standard output and error redirected to syslog via logger."
  (define exp
    #~(begin
        (use-modules (ice-9 popen))
        (let* ((pid    (number->string (getpid)))
               (logger #$(file-append inetutils "/bin/logger"))
               (args   (list "-t" #$name (string-append "--id=" pid)))
               (pipe   (apply open-pipe* OPEN_WRITE logger args)))
          (dup pipe 1)
          (dup pipe 2)
          (execl #$exec #$exec #$@args))))
  (program-file (string-append name "-logger") exp))

  parent reply	other threads:[~2019-06-26 18:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-25 18:35 bug#30939: shepherd: detailed output should be placed into well-known location and not tty ng0
2018-03-26 13:41 ` Ludovic Courtès
2018-03-26 15:10   ` ng0
2018-03-27  7:36     ` Ludovic Courtès
2018-03-27  9:15       ` ng0
2018-03-27 18:59       ` Clément Lassieur
2018-03-27 20:13       ` Mark H Weaver
2019-06-26 18:07 ` Robert Vollmert [this message]
2020-07-18 16:27 ` conjaroy

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=FABCF7A5-CE74-478C-B581-D3142FECD545@vllmrt.net \
    --to=rob@vllmrt.net \
    --cc=30939@debbugs.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 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).