From: Danny Milosavljevic <dannym@scratchpost.org>
To: 27323@debbugs.gnu.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 [thread overview]
Message-ID: <20170614074902.1130-2-dannym@scratchpost.org> (raw)
In-Reply-To: <20170614074902.1130-1-dannym@scratchpost.org>
---
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
next prev parent reply other threads:[~2017-06-14 7:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-11 2:36 bug#27323: [PATCH shepherd] Make sure that shepherd does not serve already-served sockets Danny Milosavljevic
2017-06-14 7:49 ` [bug#27323] [PATCH v2 shepherd 0/2] " Danny Milosavljevic
2017-06-14 7:49 ` Danny Milosavljevic [this message]
2017-06-14 7:49 ` [bug#27323] [PATCH v2 shepherd 2/2] " Danny Milosavljevic
2017-06-16 8:19 ` bug#27323: [PATCH v2 shepherd 0/2] " Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170614074902.1130-2-dannym@scratchpost.org \
--to=dannym@scratchpost.org \
--cc=27323@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.