guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: services: elogind: Rely on D-Bus activation.


From: Ludovic Courtès
Subject: 03/03: services: elogind: Rely on D-Bus activation.
Date: Sun, 06 Mar 2016 23:05:14 +0000

civodul pushed a commit to branch master
in repository guix.

commit 956ad60cadbea000c1247afee91f48ca2e33c14d
Author: Ludovic Courtès <address@hidden>
Date:   Mon Mar 7 00:01:03 2016 +0100

    services: elogind: Rely on D-Bus activation.
    
    Previously elogind was explicitly spawned by the Shepherd.  Now it is
    activated by dbus-daemon on demand.
    
    * gnu/packages/freedesktop.scm (elogind)[arguments]: Add
    'fix-service-file' phase.
    * gnu/services/desktop.scm (elogind-shepherd-service): Remove.
    (elogind-dbus-service): New procedure.
    (elogind-service-type): Do not extend SHEPHERD-ROOT-SERVICE-TYPE.  Use
    'elogind-dbus-service' for DBUS-ROOT-SERVICE-TYPE.
---
 gnu/packages/freedesktop.scm |   14 ++++++++++++--
 gnu/services/desktop.scm     |   27 +++++++--------------------
 2 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index 5252ddb..f75f5fd 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2015 Andreas Enge <address@hidden>
 ;;; Copyright © 2015 Sou Bunnbu <address@hidden>
 ;;; Copyright © 2015 Andy Wingo <address@hidden>
-;;; Copyright © 2015 Ludovic Courtès <address@hidden>
+;;; Copyright © 2015, 2016 Ludovic Courtès <address@hidden>
 ;;; Copyright © 2015 Ricardo Wurmus <address@hidden>
 ;;; Copyright © 2015 David Hashe <address@hidden>
 ;;; Copyright © 2016 Efraim Flashner <address@hidden>
@@ -169,7 +169,17 @@ the freedesktop.org XDG Base Directory specification.")
              ;; XXX: fail with:
              ;;  src/shared/clean-ipc.c:315: undefined reference to `mq_unlink'
              "LDFLAGS=-lrt")
-       #:make-flags 
'("PKTTYAGENT=/run/current-system/profile/bin/pkttyagent")))
+       #:make-flags '("PKTTYAGENT=/run/current-system/profile/bin/pkttyagent")
+
+       #:phases (modify-phases %standard-phases
+                  (add-before 'build 'fix-service-file
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      ;; Fix the file name of the 'elogind' binary in the D-Bus
+                      ;; '.service' file.
+                      (substitute* "src/login/org.freedesktop.login1.service"
+                        (("^Exec=.*")
+                         (string-append "Exec=" (assoc-ref %outputs "out")
+                                        "/libexec/elogind/elogind\n"))))))))
     (native-inputs
      `(("intltool" ,intltool)
        ("gettext" ,gnu-gettext)
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 02bcf1b..c20569f 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -647,22 +647,11 @@ include the @command{udisksctl} command, part of UDisks, 
and GNOME Disks."
    ("HybridSleepState" (sleep-list elogind-hybrid-sleep-state))
    ("HybridSleepMode" (sleep-list elogind-hybrid-sleep-mode))))
 
-(define (elogind-shepherd-service config)
-  "Return a shepherd service for elogind, using @var{config}."
-  ;; TODO: We could probably rely on service activation but the '.service'
-  ;; file currently contains an erroneous 'Exec' line.
-  (let ((config-file (elogind-configuration-file config))
-        (elogind     (elogind-package config)))
-    (list (shepherd-service
-           (documentation "Run the elogind login and seat management service.")
-           (provision '(elogind))
-           (requirement '(dbus-system))
-
-           (start #~(make-forkexec-constructor
-                     (list (string-append #$elogind 
"/libexec/elogind/elogind"))
-                     #:environment-variables
-                     (list (string-append "ELOGIND_CONF_FILE=" 
#$config-file))))
-           (stop #~(make-kill-destructor))))))
+(define (elogind-dbus-service config)
+  (list (wrapped-dbus-service (elogind-package config)
+                              "libexec/elogind/elogind"
+                              "ELOGIND_CONF_FILE"
+                              (elogind-configuration-file config))))
 
 (define (pam-extension-procedure config)
   "Return an extension for PAM-ROOT-SERVICE-TYPE that ensures that all the PAM
@@ -683,10 +672,8 @@ seats.)"
 (define elogind-service-type
   (service-type (name 'elogind)
                 (extensions
-                 (list (service-extension shepherd-root-service-type
-                                          elogind-shepherd-service)
-                       (service-extension dbus-root-service-type
-                                          (compose list elogind-package))
+                 (list (service-extension dbus-root-service-type
+                                          elogind-dbus-service)
                        (service-extension udev-service-type
                                           (compose list elogind-package))
                        (service-extension polkit-service-type



reply via email to

[Prev in Thread] Current Thread [Next in Thread]