From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1estLL-0005de-Dr for guix-patches@gnu.org; Mon, 05 Mar 2018 11:52:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1estLG-0002De-IC for guix-patches@gnu.org; Mon, 05 Mar 2018 11:52:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:38239) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1estLG-0002DI-Dv for guix-patches@gnu.org; Mon, 05 Mar 2018 11:52:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1estLG-0003xx-7C for guix-patches@gnu.org; Mon, 05 Mar 2018 11:52:02 -0500 Subject: [bug#30498] [WIP v2 shepherd] shepherd: If /dev/kmsg is writable, use it for logging. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20180217122035.1443-1-dannym@scratchpost.org> <20180217164835.1178-1-dannym@scratchpost.org> <87muzvtyo3.fsf@gnu.org> <20180226233214.6fe40fa3@scratchpost.org> <87inai6b7w.fsf@gnu.org> <87bmg46d10.fsf@gnu.org> <20180303233715.7ec8a08c@scratchpost.org> Date: Mon, 05 Mar 2018 17:51:44 +0100 In-Reply-To: <20180303233715.7ec8a08c@scratchpost.org> (Danny Milosavljevic's message of "Sat, 3 Mar 2018 23:37:15 +0100") Message-ID: <87371ea2jj.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Danny Milosavljevic Cc: 30498@debbugs.gnu.org Heya, I took the liberty to split this in several patches, which I think makes it easier to follow. I omitted the bits about redirecting stderr, for now, to simplify things. I tested it in a GuixSD VM and it works as advertised! \o/ There=E2=80=99s one thing we need to improve though: syslogd reads /proc/km= sg and prefixes everything that comes from there with =E2=80=9Cvmunix=E2=80=9D= (as if it came from the kernel). That=E2=80=99s inconvenient because it makes it impossible to have syslogd rules to filter shepherd messages. So I think we need to do instead use a =E2=80=98syslog=E2=80=99-style inter= face and, similar to what =E2=80=98syslog=E2=80=99 does in glibc, write to /dev/log u= nless it=E2=80=99s unavailable, in which case we fall back to /dev/kmsg. Thoughts? I=E2=80=99ll see if I can give it a try. Thanks, Ludo=E2=80=99.