From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Vollmert Subject: bug#30939: still relevant Date: Wed, 26 Jun 2019 20:07:06 +0200 Message-ID: References: <20180325183555.cilo6qyrj43jh6he@abyayala> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:39095) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgCKz-0000zm-NR for bug-guix@gnu.org; Wed, 26 Jun 2019 14:08:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgCKx-0004Q8-Ej for bug-guix@gnu.org; Wed, 26 Jun 2019 14:08:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51705) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hgCKw-0004P9-Na for bug-guix@gnu.org; Wed, 26 Jun 2019 14:08:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hgCKw-0004oD-FE for bug-guix@gnu.org; Wed, 26 Jun 2019 14:08:02 -0400 In-Reply-To: <20180325183555.cilo6qyrj43jh6he@abyayala> Sender: "Debbugs-submit" Resent-Message-ID: List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 30939@debbugs.gnu.org This came up again recently, compare the discussion here: https://lists.gnu.org/archive/html/guix-devel/2019-06/msg00186.html Here=E2=80=99s 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=3D" 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))