diff options
author | Clément Lassieur <clement@lassieur.org> | 2018-08-13 17:35:24 +0200 |
---|---|---|
committer | Clément Lassieur <clement@lassieur.org> | 2018-08-13 18:11:02 +0200 |
commit | fdbca05d78d091bfc075e54c9fb90125262eadf0 (patch) | |
tree | fe827b9a2e06bfe8e8b9bf34352dca3c271adf54 /gnu | |
parent | 2ded865665850d9f257ee62a995658c1381a8f4a (diff) | |
download | guix-fdbca05d78d091bfc075e54c9fb90125262eadf0.tar.gz guix-fdbca05d78d091bfc075e54c9fb90125262eadf0.zip |
services: prosody: Get the Shepherd to respawn Prosody.
* gnu/services/messaging.scm (prosody-shepherd-service): Return the PID when
the action is "start".
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/services/messaging.scm | 9 |
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")))))) |