Subject: [PATCH 7/7] services: bitlbee: Use ‘make-inetd-constructor’ unconditionally.

From: Ludovic Courtès <[email-masked]>
Date: Fri, 5 Jan 2024 11:59:34 +0100

This construct was introduced in Shepherd 0.9.0.

* gnu/services/messaging.scm (bitlbee-shepherd-service): Use
‘make-inetd-constructor’ unconditionally.

Change-Id: Id1b79077d60609c7f95439ee0d097dfe6e66dd2e
---
 gnu/services/messaging.scm | 51 ++++++++++++++------------------------
 1 file changed, 18 insertions(+), 33 deletions(-)

diff --git a/gnu/services/messaging.scm b/gnu/services/messaging.scm
index 7505810e7c..9702170b3e 100644
--- a/gnu/services/messaging.scm
+++ b/gnu/services/messaging.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2018 Clément Lassieur <[email-masked]>
 ;;; Copyright © 2017 Mathieu Othacehe <[email-masked]>
-;;; Copyright © 2015, 2017-2020, 2022, 2023 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2015, 2017-2020, 2022-2024 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2018 Pierre-Antoine Rouby <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -857,39 +857,24 @@ (define bitlbee-shepherd-service
               ;; on 'networking'.
               (requirement '(user-processes networking))
 
-              (start #~(if (defined? 'make-inetd-constructor)
+              (start #~(make-inetd-constructor
+                        (list #$bitlbee* "-I" "-c" #$conf)
+                        (list (endpoint
+                               (addrinfo:addr
+                                (car (getaddrinfo #$interface
+                                                  #$(number->string port)
+                                                  (logior AI_NUMERICHOST
+                                                          AI_NUMERICSERV))))))
+                        #:requirements '#$requirement
+                        #:service-name-stem "bitlbee"
+                        #:user "bitlbee" #:group "bitlbee"
 
-                           (make-inetd-constructor
-                            (list #$bitlbee* "-I" "-c" #$conf)
-                            (list (endpoint
-                                   (addrinfo:addr
-                                    (car (getaddrinfo #$interface
-                                                      #$(number->string port)
-                                                      (logior AI_NUMERICHOST
-                                                              AI_NUMERICSERV))))))
-                            #:requirements '#$requirement
-                            #:service-name-stem "bitlbee"
-                            #:user "bitlbee" #:group "bitlbee"
-
-                            ;; Allow 'bitlbee-purple' to use libpurple plugins.
-                            #:environment-variables
-                            (list (string-append "PURPLE_PLUGIN_PATH="
-                                                 #$plugins "/lib/purple-2")
-                                  "GUIX_LOCPATH=/run/current-system/locale"))
-
-                           (make-forkexec-constructor
-                            (list #$(file-append bitlbee "/sbin/bitlbee")
-                                  "-n" "-F" "-u" "bitlbee" "-c" #$conf)
-
-                            ;; Allow 'bitlbee-purple' to use libpurple plugins.
-                            #:environment-variables
-                            (list (string-append "PURPLE_PLUGIN_PATH="
-                                                 #$plugins "/lib/purple-2"))
-
-                            #:pid-file "/var/run/bitlbee.pid")))
-              (stop  #~(if (defined? 'make-inetd-destructor)
-                           (make-inetd-destructor)
-                           (make-kill-destructor)))))))))
+                        ;; Allow 'bitlbee-purple' to use libpurple plugins.
+                        #:environment-variables
+                        (list (string-append "PURPLE_PLUGIN_PATH="
+                                             #$plugins "/lib/purple-2")
+                              "GUIX_LOCPATH=/run/current-system/locale")))
+              (stop  #~(make-inetd-destructor))))))))
 
 (define %bitlbee-accounts
   ;; User group and account to run BitlBee.
-- 
2.41.0