[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/02: services: prosody: Get the Shepherd to respawn Prosody.
From: |
Clément Lassieur |
Subject: |
02/02: services: prosody: Get the Shepherd to respawn Prosody. |
Date: |
Mon, 13 Aug 2018 12:15:39 -0400 (EDT) |
snape pushed a commit to branch master
in repository guix.
commit fdbca05d78d091bfc075e54c9fb90125262eadf0
Author: Clément Lassieur <address@hidden>
Date: Mon Aug 13 17:35:24 2018 +0200
services: prosody: Get the Shepherd to respawn Prosody.
* gnu/services/messaging.scm (prosody-shepherd-service): Return the PID when
the action is "start".
---
gnu/services/messaging.scm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/gnu/services/messaging.scm b/gnu/services/messaging.scm
index 6d3a580..1108006 100644
--- a/gnu/services/messaging.scm
+++ b/gnu/services/messaging.scm
@@ -632,13 +632,20 @@ See also @url{https://prosody.im/doc/modules/mod_muc}."
(opaque-prosody-configuration-prosody config)
(prosody-configuration-prosody config)))
(prosodyctl-bin (file-append prosody "/bin/prosodyctl"))
+ (pid-file (prosody-configuration-pidfile config))
(prosodyctl-action (lambda args
#~(lambda _
- (invoke #$prosodyctl-bin address@hidden)))))
+ (invoke #$prosodyctl-bin address@hidden)
+ (match '#$args
+ (("start")
+ (call-with-input-file #$pid-file read))
+ (_ #t))))))
(list (shepherd-service
(documentation "Run the Prosody XMPP server")
(provision '(prosody xmpp-daemon))
(requirement '(networking syslogd user-processes))
+ (modules `((ice-9 match)
+ ,@%default-modules))
(start (prosodyctl-action "start"))
(stop (prosodyctl-action "stop"))))))