services: Make sure Shepherd destructors match constructors.

This is a followup to b06ecc5751,
211fe3f66e, and
fd57ce267c.

* gnu/services/base.scm (guix-publish-shepherd-service): Change 'stop'
method to use 'make-systemd-destructor' when 'make-systemd-constructor'
is used.
* gnu/services/dict.scm (dicod-shepherd-service): Change 'stop' method
to use 'make-inetd-destructor' when 'make-inetd-constructor' is used.
* gnu/services/messaging.scm (bitlbee-shepherd-service): Likewise.
This commit is contained in:
Ludovic Courtès 2022-05-02 17:27:13 +02:00
parent 39d6c13fda
commit 2a37f174be
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
3 changed files with 11 additions and 3 deletions

View file

@ -1914,7 +1914,10 @@ (define (config->compression-options config)
(make-systemd-constructor (make-systemd-constructor
#$command #$endpoints #$@options) #$command #$endpoints #$@options)
(make-forkexec-constructor #$command #$@options))) (make-forkexec-constructor #$command #$@options)))
(stop #~(make-kill-destructor))))))) (stop #~(if (and (defined? 'make-systemd-destructor)
#$(not advertise?))
(make-systemd-destructor)
(make-kill-destructor))))))))
(define %guix-publish-accounts (define %guix-publish-accounts
(list (user-group (name "guix-publish") (system? #t)) (list (user-group (name "guix-publish") (system? #t))

View file

@ -179,7 +179,10 @@ (define (dicod-shepherd-service config)
(list #$dicod "--foreground" (list #$dicod "--foreground"
(string-append "--config=" #$dicod.conf)) (string-append "--config=" #$dicod.conf))
#:user "dicod" #:group "dicod"))) #:user "dicod" #:group "dicod")))
(stop #~(make-kill-destructor)))))) (stop #~(if (and (defined? 'make-inetd-destructor)
#$(= 1 (length interfaces))) ;XXX
(make-inetd-destructor)
(make-kill-destructor)))))))
(define dicod-service-type (define dicod-service-type
(service-type (service-type

View file

@ -883,7 +883,9 @@ (define bitlbee-shepherd-service
(source "/var/lib/bitlbee") (source "/var/lib/bitlbee")
(target source) (target source)
(writable? #t)))))) (writable? #t))))))
(stop #~(make-kill-destructor))))))))) (stop #~(if (defined? 'make-inetd-destructor)
(make-inetd-destructor)
(make-kill-destructor))))))))))
(define %bitlbee-accounts (define %bitlbee-accounts
;; User group and account to run BitlBee. ;; User group and account to run BitlBee.