mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 15:36:20 -05:00
services: elogind: Start from the Shepherd.
Fixes <http://bugs.gnu.org/27580>. Reported by William <w@vieta.uk>. * gnu/services/desktop.scm (elogind-shepherd-service): New procedure. (elogind-service-type): Extend SHEPHERD-ROOT-SERVICE-TYPE.
This commit is contained in:
parent
082725b502
commit
94a881178a
1 changed files with 21 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2015 Andy Wingo <wingo@igalia.com>
|
||||
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
||||
;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
|
||||
|
@ -653,6 +653,20 @@ (module (file-append (elogind-package config)
|
|||
(inherit pam)
|
||||
(session (cons pam-elogind (pam-service-session pam)))))))
|
||||
|
||||
(define (elogind-shepherd-service config)
|
||||
"Return a Shepherd service to start elogind according to @var{config}."
|
||||
(list (shepherd-service
|
||||
(requirement '(dbus-system))
|
||||
(provision '(elogind))
|
||||
(start #~(make-forkexec-constructor
|
||||
(list #$(file-append (elogind-package config)
|
||||
"/libexec/elogind/elogind"))
|
||||
#:environment-variables
|
||||
(list (string-append "ELOGIND_CONF_FILE="
|
||||
#$(elogind-configuration-file
|
||||
config)))))
|
||||
(stop #~(make-kill-destructor)))))
|
||||
|
||||
(define elogind-service-type
|
||||
(service-type (name 'elogind)
|
||||
(extensions
|
||||
|
@ -663,6 +677,12 @@ (define elogind-service-type
|
|||
(service-extension polkit-service-type
|
||||
(compose list elogind-package))
|
||||
|
||||
;; Start elogind from the Shepherd rather than waiting
|
||||
;; for bus activation. This ensures that it can handle
|
||||
;; events like lid close, etc.
|
||||
(service-extension shepherd-root-service-type
|
||||
elogind-shepherd-service)
|
||||
|
||||
;; Provide the 'loginctl' command.
|
||||
(service-extension profile-service-type
|
||||
(compose list elogind-package))
|
||||
|
|
Loading…
Reference in a new issue