GNU bug report logs - #55739
[PATCH 0/2] Add a verbose option for the D-Bus service.

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Tue, 31 May 2022 13:28:01 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 55739 in the body.
You can then email your comments to 55739 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#55739; Package guix-patches. (Tue, 31 May 2022 13:28:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 31 May 2022 13:28:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH 0/2] Add a verbose option for the D-Bus service.
Date: Tue, 31 May 2022 09:26:24 -0400
Hi Guix,

This was made some time ago to make debugging D-Bus issues easier on Guix
System.  I think it may still useful, so I'm sending it for inclusion.

Thanks,

Maxim Cournoyer (2):
  gnu: Add dbus-verbose.
  services: dbus: Add a VERBOSE? configuration option.

 doc/guix.texi         |  9 +++++++--
 gnu/packages/glib.scm | 15 +++++++++++++++
 gnu/services/dbus.scm | 22 +++++++++++++++++-----
 3 files changed, 39 insertions(+), 7 deletions(-)

-- 
2.36.0





Information forwarded to guix-patches <at> gnu.org:
bug#55739; Package guix-patches. (Tue, 31 May 2022 13:32:02 GMT) Full text and rfc822 format available.

Message #8 received at 55739 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 55739 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH 1/2] gnu: Add dbus-verbose.
Date: Tue, 31 May 2022 09:30:53 -0400
* gnu/packages/glib.scm (dbus-verbose): New variable.
---
 gnu/packages/glib.scm | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 30e5433776..25bd5871b0 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -176,6 +176,21 @@ (define dbus
 shared NFS home directories.")
     (license license:gpl2+)))                     ; or Academic Free License 2.1
 
+;;; The reason this is not enabled in the regular dbus package is because it
+;;; impacts the performance of D-Bus (including its library) as a whole, even
+;;; when the DBUS_VERBOSE environment variable is not set.
+(define-public dbus-verbose
+  (package/inherit dbus
+    (name "dbus-verbose")
+    (arguments (substitute-keyword-arguments (package-arguments dbus)
+                 ((#:configure-flags flags '())
+                  `(cons "--enable-verbose-mode" ,flags))))
+    (synopsis "D-Bus with verbose mode enabled for debugging")
+    (description "This variant D-Bus package is built with verbose mode, which
+eases debugging of D-Bus services by printing various debug information when
+the @code{DBUS_VERBOSE} environment variable is set to @samp{1}.  For more
+information, refer to the @samp{dbus-daemon(1)} man page.")))
+
 (define glib
   (package
     (name "glib")
-- 
2.36.0





Information forwarded to guix-patches <at> gnu.org:
bug#55739; Package guix-patches. (Tue, 31 May 2022 13:32:02 GMT) Full text and rfc822 format available.

Message #11 received at 55739 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 55739 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH 2/2] services: dbus: Add a VERBOSE? configuration option.
Date: Tue, 31 May 2022 09:30:54 -0400
* 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.
---
 doc/guix.texi         |  9 +++++++--
 gnu/services/dbus.scm | 22 +++++++++++++++++-----
 2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 88e009fe7c..3e12af2067 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -21761,9 +21761,14 @@ The actual service definitions included in @code{%desktop-services} and
 provided by @code{(gnu services dbus)} and @code{(gnu services desktop)}
 are described below.
 
-@deffn {Scheme Procedure} dbus-service [#:dbus @var{dbus}] [#:services '()]
+@deffn {Scheme Procedure} dbus-service [#:dbus @var{dbus}] [#:services '()] @
+                                       [#:verbose?]
 Return a service that runs the ``system bus'', using @var{dbus}, with
-support for @var{services}.
+support for @var{services}.  When @var{verbose?} is true, it causes the
+@samp{DBUS_VERBOSE} environment variable to be set to @samp{1}; a
+verbose-enabled D-Bus package such as @code{dbus-verbose} should be
+provided as @var{dbus} in this scenario.  The verbose output is logged
+to @file{/var/log/dbus-daemon.log}.
 
 @uref{https://dbus.freedesktop.org/, D-Bus} is an inter-process communication
 facility.  Its system bus is used to allow system services to communicate
diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm
index ef6b82c572..52cb1e3a51 100644
--- a/gnu/services/dbus.scm
+++ b/gnu/services/dbus.scm
@@ -53,7 +53,9 @@ (define-record-type* <dbus-configuration>
   (dbus      dbus-configuration-dbus              ;file-like
              (default dbus))
   (services  dbus-configuration-services          ;list of <package>
-             (default '())))
+             (default '()))
+  (verbose?  dbus-configuration-verbose?          ;boolean
+             (default #f)))
 
 (define (system-service-directory services)
   "Return the system service directory, containing @code{.service} files for
@@ -191,7 +193,7 @@ (define (dbus-activation config)
 
 (define dbus-shepherd-service
   (match-lambda
-    (($ <dbus-configuration> dbus)
+    (($ <dbus-configuration> dbus _ verbose?)
      (list (shepherd-service
             (documentation "Run the D-Bus system daemon.")
             (provision '(dbus-system))
@@ -199,6 +201,12 @@ (define dbus-shepherd-service
             (start #~(make-forkexec-constructor
                       (list (string-append #$dbus "/bin/dbus-daemon")
                             "--nofork" "--system" "--syslog-only")
+                      #$@(if verbose?
+                             ;; Since the verbose output goes to the console,
+                             ;; not syslog, add a log file to capture it.
+                             '(#:environment-variables '("DBUS_VERBOSE=1")
+                               #:log-file "/var/log/dbus-daemon.log")
+                             '())
                       #:pid-file "/var/run/dbus/pid"))
             (stop #~(make-kill-destructor)))))))
 
@@ -234,9 +242,12 @@ (define dbus-root-service-type
 bus.  It allows programs and daemons to communicate and is also responsible
 for spawning (@dfn{activating}) D-Bus services on demand.")))
 
-(define* (dbus-service #:key (dbus dbus) (services '()))
+(define* (dbus-service #:key (dbus dbus) (services '()) verbose?)
   "Return a service that runs the \"system bus\", using @var{dbus}, with
-support for @var{services}.
+support for @var{services}.  When @var{verbose?} is true, it causes the
+@samp{DBUS_VERBOSE} environment variable to be set to @samp{1}; a
+verbose-enabled D-Bus package such as @code{dbus-verbose} should be provided
+as @var{dbus} in this scenario.
 
 @uref{http://dbus.freedesktop.org/, D-Bus} is an inter-process communication
 facility.  Its system bus is used to allow system services to communicate and
@@ -248,7 +259,8 @@ (define* (dbus-service #:key (dbus dbus) (services '()))
 @var{services} must be equal to @code{(list avahi)}."
   (service dbus-root-service-type
            (dbus-configuration (dbus dbus)
-                               (services services))))
+                               (services services)
+                               (verbose? verbose?))))
 
 (define (wrapped-dbus-service service program variables)
   "Return a wrapper for @var{service}, a package containing a D-Bus service,
-- 
2.36.0





bug closed, send any further explanations to 55739 <at> debbugs.gnu.org and Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Request was from Maxim Cournoyer <maxim.cournoyer <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 14 Jun 2022 18:47:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 13 Jul 2022 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 287 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.