From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] dmd: Allow storing early logs before writing to disk Date: Thu, 11 Sep 2014 16:31:36 +0200 Message-ID: <87sijyqldj.fsf@gnu.org> References: <87d2b36nak.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS5PX-0005zd-Q2 for guix-devel@gnu.org; Thu, 11 Sep 2014 10:31:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XS5PO-0002zx-Q6 for guix-devel@gnu.org; Thu, 11 Sep 2014 10:31:47 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:38446) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS5PO-0002zf-KB for guix-devel@gnu.org; Thu, 11 Sep 2014 10:31:38 -0400 In-Reply-To: <87d2b36nak.fsf@gmail.com> (David Michael's message of "Wed, 10 Sep 2014 19:58:11 -0400") 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: David Michael Cc: guix-devel@gnu.org David Michael skribis: > When using dmd to bring up a read-only file system, it will quit when it > fails to open a log file for writing. Out of curiosity, are you trying to use dmd in the initrd, or maybe on GNU/Hurd? > This is a proof-of-concept patch that adds the option to start writing > logs to a string port. It allows having a dmdconf.scm that runs fsck, > makes the disk writable, and then starts writing past and future log > messages to disk with (start-logging "/var/log/dmd.log"). That sounds useful. > Does anyone have any thoughts on this? Is there a better way to handle > this case? The problem is: when does it figure out that it can now write to the file? The ideal thing would be: 1. Run =E2=80=98dmd -l foo.log=E2=80=99. 2. If foo.log is not writable, then make =E2=80=98log-output-port=E2=80= =99 a string port. 3. When foo.log becomes writable, have =E2=80=98log-output-port=E2=80=99 = point to it and dump previously buffered data. But #3 is difficult. Maybe instead of using a string port, we could use a string port that keeps trying to open the log file? It would be best to use inotify (or the Hurd=E2=80=99s fs_notify), of cours= e. Ludo=E2=80=99.