guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dmd] 01/02: dmd: Ignore 'daemonize' command when running as PID 1.


From: Ludovic Courtès
Subject: [dmd] 01/02: dmd: Ignore 'daemonize' command when running as PID 1.
Date: Wed, 05 Nov 2014 09:28:37 +0000

civodul pushed a commit to branch master
in repository dmd.

commit 01fd792e5871eddff04aad1c22601d0066a1908a
Author: Ludovic Courtès <address@hidden>
Date:   Wed Nov 5 10:26:50 2014 +0100

    dmd: Ignore 'daemonize' command when running as PID 1.
    
    * modules/dmd/service.scm (dmd-service)[daemonizing]: Do nothing
      when (getpid) returns 1.
---
 modules/dmd/service.scm |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/modules/dmd/service.scm b/modules/dmd/service.scm
index 9ce2cd9..7e8d281 100644
--- a/modules/dmd/service.scm
+++ b/modules/dmd/service.scm
@@ -1044,9 +1044,13 @@ if previously spawned childs terminate.  Therefore, this 
action should
 usually only be used (if at all) *before* childs get spawned for which
 we want to receive these signals."
       (lambda (running)
-       (if (zero? (primitive-fork))
-           #t
-            (primitive-exit 0))))
+        (case (getpid)
+          ((1)
+           (local-output "Running as PID 1, so not daemonizing."))
+          (else
+           (if (zero? (primitive-fork))
+               #t
+               (primitive-exit 0))))))
      (persistency
       "Safe the current state of running and non-running services.
 This status gets written into a file on termination, so that we can



reply via email to

[Prev in Thread] Current Thread [Next in Thread]