commit 3c459670690f90f85905d241d230a7541a41fe15 Author: Ludovic Courtès Date: Tue Feb 18 15:10:28 2014 +0100 dmd: Add '--pid' option. * modules/dmd.scm (main): Add '--pid' option and honor it. * tests/basic.sh: Run dmd with '--pid'. Wait for the PID file to be available, for synchronization. * tests/respawn.sh: Likewise. * dmd.texi (Invoking dmd): Document '--pid'. Modified dmd.texi diff --git a/dmd.texi b/dmd.texi index a970894..f7306db 100644 --- a/dmd.texi +++ b/dmd.texi @@ -369,6 +369,10 @@ Log output into @var{file}, or if @var{file} is not given, @code{/var/log/dmd.log} when running as superuser, @var{~/.dmd.log} otherwise. +@item --pid[=@var{file}] +When dmd is ready to accept connections, write its PID to @var{file} or +to the standard output if @var{file} is omitted. + @item -p [@var{file}] @itemx --persistency[=@var{file}] @c FIXME-CRITICAL Modified modules/dmd.scm diff --git a/modules/dmd.scm b/modules/dmd.scm index df41eb3..bfa579f 100644 --- a/modules/dmd.scm +++ b/modules/dmd.scm @@ -1,5 +1,5 @@ ;; dmd.scm -- Daemon managing Daemons (or Daemons-managing Daemon?) -;; Copyright (C) 2013 Ludovic Courts +;; Copyright (C) 2013, 2014 Ludovic Courts ;; Copyright (C) 2002, 2003 Wolfgang Jhrling ;; ;; This file is part of GNU dmd. @@ -23,6 +23,7 @@ #:use-module (ice-9 readline) ;; Readline (for interactive use). #:use-module (oop goops) ;; Defining classes and methods. #:use-module (srfi srfi-1) ;; List library. + #:use-module (srfi srfi-26) #:use-module (dmd config) #:use-module (dmd support) #:use-module (dmd service) @@ -54,6 +55,7 @@ (let ((config-file default-config-file) (socket-file default-socket-file) + (pid-file #f) (insecure #f) (logfile default-logfile)) ;; Process command line arguments. @@ -99,6 +101,12 @@ #:action (lambda (file) (set! logfile file))) (make