summary refs log tree commit diff
diff options
context:
space:
mode:
authorClément Lassieur <clement@lassieur.org>2018-08-13 17:35:24 +0200
committerClément Lassieur <clement@lassieur.org>2018-08-13 18:11:02 +0200
commitfdbca05d78d091bfc075e54c9fb90125262eadf0 (patch)
treefe827b9a2e06bfe8e8b9bf34352dca3c271adf54
parent2ded865665850d9f257ee62a995658c1381a8f4a (diff)
downloadguix-fdbca05d78d091bfc075e54c9fb90125262eadf0.tar.gz
services: prosody: Get the Shepherd to respawn Prosody.
* gnu/services/messaging.scm (prosody-shepherd-service): Return the PID when
the action is "start".
-rw-r--r--gnu/services/messaging.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/gnu/services/messaging.scm b/gnu/services/messaging.scm
index 6d3a5803c2..1108006411 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 #$@args)))))
+                                  (invoke #$prosodyctl-bin #$@args)
+                                  (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"))))))