From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Michael Subject: [PATCH] dmd: Allow storing early logs before writing to disk Date: Wed, 10 Sep 2014 19:58:11 -0400 Message-ID: <87d2b36nak.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRrjH-0000I5-TH for guix-devel@gnu.org; Wed, 10 Sep 2014 19:55:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRrj8-00066e-SQ for guix-devel@gnu.org; Wed, 10 Sep 2014 19:55:15 -0400 Received: from mail-qc0-x232.google.com ([2607:f8b0:400d:c01::232]:33092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRrj8-000647-Oo for guix-devel@gnu.org; Wed, 10 Sep 2014 19:55:06 -0400 Received: by mail-qc0-f178.google.com with SMTP id x13so20707095qcv.9 for ; Wed, 10 Sep 2014 16:55:05 -0700 (PDT) Received: from callisto (c-68-81-204-146.hsd1.pa.comcast.net. [68.81.204.146]) by mx.google.com with ESMTPSA id 89sm373921qgj.49.2014.09.10.16.55.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Sep 2014 16:55:05 -0700 (PDT) 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: guix-devel@gnu.org * modules/dmd.scm (main): Start logging to a buffer instead of a file when the logfile option is set to "delayed". * modules/dmd/comm.scm (start-logging-to-buffer): New procedure. (start-logging): If logs were being written to a string port, write its contents to the log file. --- Hi, When using dmd to bring up a read-only file system, it will quit when it fails to open a log file for writing. 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"). Does anyone have any thoughts on this? Is there a better way to handle this case? Thanks. David modules/dmd.scm | 7 +++++-- modules/dmd/comm.scm | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/modules/dmd.scm b/modules/dmd.scm index cf72d7a..e0f69c7 100644 --- a/modules/dmd.scm +++ b/modules/dmd.scm @@ -97,7 +97,8 @@ (make