GNU bug report logs - #27323
[PATCH shepherd] Make sure that shepherd does not serve already-served sockets.

Previous Next

Package: guix-patches;

Reported by: Danny Milosavljevic <dannym <at> scratchpost.org>

Date: Sun, 11 Jun 2017 02:38:01 UTC

Severity: normal

Tags: patch

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: 27323 <at> debbugs.gnu.org
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>
Subject: [bug#27323] [PATCH v2 shepherd 1/2] Use XDG_RUNTIME_DIR for the shepherd socket.
Date: Wed, 14 Jun 2017 09:49:01 +0200
---
 modules/shepherd/support.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/shepherd/support.scm b/modules/shepherd/support.scm
index e50de74..ea98b5f 100644
--- a/modules/shepherd/support.scm
+++ b/modules/shepherd/support.scm
@@ -251,6 +251,11 @@ There is NO WARRANTY, to the extent permitted by law.")))
                      (string-append user-homedir "/.config"))
                  "/shepherd"))
 
+(define %user-runtime-dir
+  ;; Default runtime directory if shepherd is run as a normal user.
+  (string-append (or (getenv "XDG_RUNTIME_DIR")
+                     (format #f "/run/user/~s" (getuid)))))
+
 (define (make-bare-init-file target)
   "Return #t if a bare init file was created at TARGET; #f otherwise.
 
@@ -301,7 +306,7 @@ create a template configuration file if non exists."
 (define default-socket-dir
   (if (zero? (getuid))
       %system-socket-dir
-      (string-append %user-config-dir "/run")))
+      (string-append %user-runtime-dir "/shepherd")))
 
 ;; Unix domain socket for receiving commands in shepherd.
 (define default-socket-file




This bug report was last modified 7 years and 340 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.