mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 22:08:16 -05:00
services: prosody: Get the Shepherd to respawn Prosody.
* gnu/services/messaging.scm (prosody-shepherd-service): Return the PID when the action is "start".
This commit is contained in:
parent
2ded865665
commit
fdbca05d78
1 changed files with 8 additions and 1 deletions
|
@ -632,13 +632,20 @@ (define (prosody-shepherd-service config)
|
||||||
(opaque-prosody-configuration-prosody config)
|
(opaque-prosody-configuration-prosody config)
|
||||||
(prosody-configuration-prosody config)))
|
(prosody-configuration-prosody config)))
|
||||||
(prosodyctl-bin (file-append prosody "/bin/prosodyctl"))
|
(prosodyctl-bin (file-append prosody "/bin/prosodyctl"))
|
||||||
|
(pid-file (prosody-configuration-pidfile config))
|
||||||
(prosodyctl-action (lambda args
|
(prosodyctl-action (lambda args
|
||||||
#~(lambda _
|
#~(lambda _
|
||||||
(invoke #$prosodyctl-bin #$@args)))))
|
(invoke #$prosodyctl-bin #$@args)
|
||||||
|
(match '#$args
|
||||||
|
(("start")
|
||||||
|
(call-with-input-file #$pid-file read))
|
||||||
|
(_ #t))))))
|
||||||
(list (shepherd-service
|
(list (shepherd-service
|
||||||
(documentation "Run the Prosody XMPP server")
|
(documentation "Run the Prosody XMPP server")
|
||||||
(provision '(prosody xmpp-daemon))
|
(provision '(prosody xmpp-daemon))
|
||||||
(requirement '(networking syslogd user-processes))
|
(requirement '(networking syslogd user-processes))
|
||||||
|
(modules `((ice-9 match)
|
||||||
|
,@%default-modules))
|
||||||
(start (prosodyctl-action "start"))
|
(start (prosodyctl-action "start"))
|
||||||
(stop (prosodyctl-action "stop"))))))
|
(stop (prosodyctl-action "stop"))))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue