From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Vollmert Subject: Re: where to put helper to send stdout/stderr to syslog? Date: Mon, 17 Jun 2019 15:12:27 +0200 Message-ID: References: <20190617144549.3430003f@scratchpost.org> Mime-Version: 1.0 (1.0) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:52672) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcrR5-0006Hj-Nt for guix-devel@gnu.org; Mon, 17 Jun 2019 09:12:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcrR4-0002LL-Ln for guix-devel@gnu.org; Mon, 17 Jun 2019 09:12:35 -0400 Received: from mx2.mailbox.org ([80.241.60.215]:28148) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hcrR4-0002I8-Ei for guix-devel@gnu.org; Mon, 17 Jun 2019 09:12:34 -0400 In-Reply-To: <20190617144549.3430003f@scratchpost.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Danny Milosavljevic Cc: guix-devel@gnu.org > On 17. Jun 2019, at 14:45, Danny Milosavljevic wr= ote: >=20 > But doesn't shepherd already log to /dev/kmsg and/or /dev/log (so that end= s up > in syslog)? Since exec-command&co keep the standard output and standard e= rror, > they (and thus all shepherd services) should also already log to the > aforementioned syslog by default. >=20 > What is the use case you envision? It sure doesn=E2=80=99t seem like it. For that service, everything lands on /dev/console, and I even see some sshd messages there that don=E2=80=99t make it to syslog... >> Would logger-wrapper be generally useful to have available? If so, >> is it named well, and where would it fit? >=20 > I think it could be made part of shepherd and be exported there, then ever= yone > could use it. Logging to syslog isn't exactly an obscure requirement :) Oh I agree that shepherd should in principle deal with capturing stdout/stderr. I rather like how systemd=E2=80=98s status command shows the last few lines of process output. Just not sure this kind if wrapper fits there. > P. S. The way you invoke logger (without full path or gexp package referen= ce) > it will pick up a random logger implementation. I'm surprised that it wor= ks > at all that way. I didn=E2=80=99t figure out how else to refer to it. It=E2=80=99s part of bs= dutils upstream as far as I can tell, and installed by default. > P. S. Your implementation has shell injection because "name" could contain= > spaces and/or semicolons. I suggest not to use the shell command string b= ut > rather passing logger's argv directly. Ok, will try to figure out how to open pipes with explicit argv. Thanks Robert=