mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
home: services: Use %user-log-dir as the log directory for all services.
* gnu/home/services/desktop.scm (home-dbus-shepherd-services): Log to %user-log-dir. * gnu/home/services/desktop.scm (home-unclutter-shepherd-services): Same. * gnu/home/services/pm.scm (home-batsignal-shepherd-services): Same. * gnu/home/services/shepherd.scm (launch-shepherd-gexp): Don't overwrite default log-file. Change-Id: I2742371cbddd1bf4d981efc41f3eae8f148336be Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
d5eab53a72
commit
53ef4bf537
3 changed files with 14 additions and 28 deletions
|
@ -298,6 +298,7 @@ according to time of day.")))
|
||||||
(list (shepherd-service
|
(list (shepherd-service
|
||||||
(documentation "Run the D-Bus daemon in session-specific mode.")
|
(documentation "Run the D-Bus daemon in session-specific mode.")
|
||||||
(provision '(dbus))
|
(provision '(dbus))
|
||||||
|
(modules '((shepherd support))) ;for '%user-log-dir'
|
||||||
(start #~(make-forkexec-constructor
|
(start #~(make-forkexec-constructor
|
||||||
(list #$(file-append (home-dbus-dbus config)
|
(list #$(file-append (home-dbus-dbus config)
|
||||||
"/bin/dbus-daemon")
|
"/bin/dbus-daemon")
|
||||||
|
@ -310,10 +311,7 @@ according to time of day.")))
|
||||||
(cons "DBUS_VERBOSE=1"
|
(cons "DBUS_VERBOSE=1"
|
||||||
(default-environment-variables))
|
(default-environment-variables))
|
||||||
#:log-file
|
#:log-file
|
||||||
(format #f "~a/log/dbus.log"
|
(string-append %user-log-dir "/dbus.log")))
|
||||||
(or (getenv "XDG_STATE_HOME")
|
|
||||||
(format #f "~a/.local/state"
|
|
||||||
(getenv "HOME"))))))
|
|
||||||
(stop #~(make-kill-destructor)))))
|
(stop #~(make-kill-destructor)))))
|
||||||
|
|
||||||
(define (home-dbus-environment-variables config)
|
(define (home-dbus-environment-variables config)
|
||||||
|
@ -352,7 +350,8 @@ according to time of day.")))
|
||||||
;; Depend on 'x11-display', which sets 'DISPLAY' if an X11 server is
|
;; Depend on 'x11-display', which sets 'DISPLAY' if an X11 server is
|
||||||
;; available, and fails to start otherwise.
|
;; available, and fails to start otherwise.
|
||||||
(requirement '(x11-display))
|
(requirement '(x11-display))
|
||||||
(modules '((srfi srfi-1)
|
(modules '((shepherd support) ;for %user-log-dir
|
||||||
|
(srfi srfi-1)
|
||||||
(srfi srfi-26)))
|
(srfi srfi-26)))
|
||||||
(one-shot? #t)
|
(one-shot? #t)
|
||||||
(start #~(lambda _
|
(start #~(lambda _
|
||||||
|
@ -369,11 +368,8 @@ according to time of day.")))
|
||||||
(cons (string-append "DISPLAY=" (getenv "DISPLAY"))
|
(cons (string-append "DISPLAY=" (getenv "DISPLAY"))
|
||||||
(remove (cut string-prefix? "DISPLAY=" <>)
|
(remove (cut string-prefix? "DISPLAY=" <>)
|
||||||
(default-environment-variables)))
|
(default-environment-variables)))
|
||||||
#:log-file (string-append
|
#:log-file
|
||||||
(or (getenv "XDG_STATE_HOME")
|
(string-append %user-log-dir "/unclutter.log")))))))
|
||||||
(format #f "~a/.local/state"
|
|
||||||
(getenv "HOME")))
|
|
||||||
"/log/unclutter.log")))))))
|
|
||||||
|
|
||||||
(define home-unclutter-service-type
|
(define home-unclutter-service-type
|
||||||
(service-type
|
(service-type
|
||||||
|
|
|
@ -88,6 +88,7 @@
|
||||||
(list (shepherd-service
|
(list (shepherd-service
|
||||||
(provision '(batsignal))
|
(provision '(batsignal))
|
||||||
(documentation "Run the batsignal battery-watching daemon.")
|
(documentation "Run the batsignal battery-watching daemon.")
|
||||||
|
(modules '((shepherd support))) ;for '%user-log-dir'
|
||||||
(start #~(make-forkexec-constructor
|
(start #~(make-forkexec-constructor
|
||||||
(append (list #$(file-append batsignal "/bin/batsignal")
|
(append (list #$(file-append batsignal "/bin/batsignal")
|
||||||
"-w" (number->string #$warning-level)
|
"-w" (number->string #$warning-level)
|
||||||
|
@ -127,11 +128,8 @@
|
||||||
(if #$ignore-missing?
|
(if #$ignore-missing?
|
||||||
(list "-i")
|
(list "-i")
|
||||||
(list)))
|
(list)))
|
||||||
#:log-file (string-append
|
#:log-file
|
||||||
(or (getenv "XDG_STATE_HOME")
|
(string-append %user-log-dir "/batsignal.log")))
|
||||||
(format #f "~a/.local/state"
|
|
||||||
(getenv "HOME")))
|
|
||||||
"/log/batsignal.log")))
|
|
||||||
(stop #~(make-kill-destructor))))))
|
(stop #~(make-kill-destructor))))))
|
||||||
|
|
||||||
(define home-batsignal-service-type
|
(define home-batsignal-service-type
|
||||||
|
|
|
@ -120,19 +120,11 @@ as shepherd package."
|
||||||
(or (getenv "XDG_RUNTIME_DIR")
|
(or (getenv "XDG_RUNTIME_DIR")
|
||||||
(format #f "/run/user/~a" (getuid)))
|
(format #f "/run/user/~a" (getuid)))
|
||||||
"/shepherd/socket"))
|
"/shepherd/socket"))
|
||||||
(let* ((state-dir (or (getenv "XDG_STATE_HOME")
|
(system*
|
||||||
(format #f "~a/.local/state"
|
#$(file-append shepherd "/bin/shepherd")
|
||||||
(getenv "HOME"))))
|
#$@(if silent? '("--silent") '())
|
||||||
(log-dir (string-append state-dir "/log")))
|
"--config"
|
||||||
;; TODO: Remove it, 0.9.2 creates it automatically?
|
#$(home-shepherd-configuration-file config))))
|
||||||
((@ (guix build utils) mkdir-p) log-dir)
|
|
||||||
(system*
|
|
||||||
#$(file-append shepherd "/bin/shepherd")
|
|
||||||
"--logfile"
|
|
||||||
(string-append log-dir "/shepherd.log")
|
|
||||||
#$@(if silent? '("--silent") '())
|
|
||||||
"--config"
|
|
||||||
#$(home-shepherd-configuration-file config)))))
|
|
||||||
#~"")))
|
#~"")))
|
||||||
|
|
||||||
(define (reload-configuration-gexp config)
|
(define (reload-configuration-gexp config)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue