David Michael <fedora....@gmail.com> 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 ‘dmd -l foo.log’.
  2. If foo.log is not writable, then make ‘log-output-port’ a string
     port.
  3. When foo.log becomes writable, have ‘log-output-port’ 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’s fs_notify), of course.

Ludo’.

Reply via email to