summaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-12-07 22:48:39 -0500
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-06-14 14:23:21 -0400
commita860a5fa95a743093cbda5540fb5be7800439a9f (patch)
tree757657410edc55e566139d10fbda2ff874e3e6dc /gnu/services
parent3aaf52a129ccf1d42aefd31322d21f697ce026b4 (diff)
services: dbus: Add a VERBOSE? configuration option.
* gnu/services/dbus.scm (<dbus-configuration>)[verbose?]: New field. (dbus-shepherd-service): Use it. (dbus-service)[verbose?]: Add argument and update doc. * doc/guix.texi (Desktop Services): Document it.
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/dbus.scm22
1 files changed, 17 insertions, 5 deletions
diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm
index ef6b82c5723..52cb1e3a516 100644
--- a/gnu/services/dbus.scm
+++ b/gnu/services/dbus.scm
@@ -53,7 +53,9 @@
53 (dbus dbus-configuration-dbus ;file-like 53 (dbus dbus-configuration-dbus ;file-like
54 (default dbus)) 54 (default dbus))
55 (services dbus-configuration-services ;list of <package> 55 (services dbus-configuration-services ;list of <package>
56 (default '()))) 56 (default '()))
57 (verbose? dbus-configuration-verbose? ;boolean
58 (default #f)))
57 59
58(define (system-service-directory services) 60(define (system-service-directory services)
59 "Return the system service directory, containing @code{.service} files for 61 "Return the system service directory, containing @code{.service} files for
@@ -191,7 +193,7 @@ includes the @code{etc/dbus-1/system.d} directories of each package listed in
191 193
192(define dbus-shepherd-service 194(define dbus-shepherd-service
193 (match-lambda 195 (match-lambda
194 (($ <dbus-configuration> dbus) 196 (($ <dbus-configuration> dbus _ verbose?)
195 (list (shepherd-service 197 (list (shepherd-service
196 (documentation "Run the D-Bus system daemon.") 198 (documentation "Run the D-Bus system daemon.")
197 (provision '(dbus-system)) 199 (provision '(dbus-system))
@@ -199,6 +201,12 @@ includes the @code{etc/dbus-1/system.d} directories of each package listed in
199 (start #~(make-forkexec-constructor 201 (start #~(make-forkexec-constructor
200 (list (string-append #$dbus "/bin/dbus-daemon") 202 (list (string-append #$dbus "/bin/dbus-daemon")
201 "--nofork" "--system" "--syslog-only") 203 "--nofork" "--system" "--syslog-only")
204 #$@(if verbose?
205 ;; Since the verbose output goes to the console,
206 ;; not syslog, add a log file to capture it.
207 '(#:environment-variables '("DBUS_VERBOSE=1")
208 #:log-file "/var/log/dbus-daemon.log")
209 '())
202 #:pid-file "/var/run/dbus/pid")) 210 #:pid-file "/var/run/dbus/pid"))
203 (stop #~(make-kill-destructor))))))) 211 (stop #~(make-kill-destructor)))))))
204 212
@@ -234,9 +242,12 @@ includes the @code{etc/dbus-1/system.d} directories of each package listed in
234bus. It allows programs and daemons to communicate and is also responsible 242bus. It allows programs and daemons to communicate and is also responsible
235for spawning (@dfn{activating}) D-Bus services on demand."))) 243for spawning (@dfn{activating}) D-Bus services on demand.")))
236 244
237(define* (dbus-service #:key (dbus dbus) (services '())) 245(define* (dbus-service #:key (dbus dbus) (services '()) verbose?)
238 "Return a service that runs the \"system bus\", using @var{dbus}, with 246 "Return a service that runs the \"system bus\", using @var{dbus}, with
239support for @var{services}. 247support for @var{services}. When @var{verbose?} is true, it causes the
248@samp{DBUS_VERBOSE} environment variable to be set to @samp{1}; a
249verbose-enabled D-Bus package such as @code{dbus-verbose} should be provided
250as @var{dbus} in this scenario.
240 251
241@uref{http://dbus.freedesktop.org/, D-Bus} is an inter-process communication 252@uref{http://dbus.freedesktop.org/, D-Bus} is an inter-process communication
242facility. Its system bus is used to allow system services to communicate and 253facility. Its system bus is used to allow system services to communicate and
@@ -248,7 +259,8 @@ and policy files. For example, to allow avahi-daemon to use the system bus,
248@var{services} must be equal to @code{(list avahi)}." 259@var{services} must be equal to @code{(list avahi)}."
249 (service dbus-root-service-type 260 (service dbus-root-service-type
250 (dbus-configuration (dbus dbus) 261 (dbus-configuration (dbus dbus)
251 (services services)))) 262 (services services)
263 (verbose? verbose?))))
252 264
253(define (wrapped-dbus-service service program variables) 265(define (wrapped-dbus-service service program variables)
254 "Return a wrapper for @var{service}, a package containing a D-Bus service, 266 "Return a wrapper for @var{service}, a package containing a D-Bus service,