Starting dbus-services over valgrind

Дилян Палаузов dilyan.palauzov at aegee.org
Fri Jul 6 19:19:39 UTC 2018


Hello,

thanks for your responses.

Consider following additions to the documentation, once you clarify
exactly what form of exec() is called.

Regards
  Дилян

diff --git a/doc/dbus-specification.xml b/doc/dbus-specification.xml
---
a/doc/dbus-specification.xml
+++ b/doc/dbus-specification.xml
@@ -4779,7
+4779,13 @@
         Service description files must contain a
        
<literal>D-BUS Service</literal> group with at least the keys
        
<literal>Name</literal> (the well-known name of the service)
-       
and <literal>Exec</literal> (the command to be executed).
+        and
<literal>Exec</literal> (the command to be executed).  The program to
+ 
      be executed is passed to execl(), execlp(), execv(), execvp() or
execve(),
+        shell redirections in this line will therefore not
work.  To achive this
+        you can replace the line with
+       
<literal>Exec=/bin/bash -c 'exec your-command &>> /tmp/file1'</literal>

+        or create an executable shell script as a separate file, that
does the right thing
+        and is called from
<literal>Exec=</literal>.
 
         <figure>
           <title>Example
service description file</title>
diff --git a/doc/system-activation.txt b/doc/system-activation.txt
--- a/doc/system-activation.txt
+++ b/doc/system-activation.txt
@@ -55,6 +55,12 @@ Precautions taken:
 * We are super paranoid about the user that called us, and what permissions we have.
 * We clear all environment variables except for DBUS_VERBOSE which is used for debugging
 * Anything out of the ordinary causes the helper to abort.
+* The parameters in Exec= are passed directly to execl(), execlp(), execv(), execvp() or
+  execve().  Shell redirections in this line will therefore not work.  To achive this
+  you can replace the line with
+    Exec=/bin/bash -c 'exec your-command &>> /tmp/file1'
+  or create an executable shell script as a separate file, that does the right thing and
+  is called from Exec=.
 
 Launching services:
 


On Fri, 2018-07-06 at 08:00 -0700, Thiago Macieira wrote:
> On Thursday, 5 July 2018 14:15:29 PDT Дилян Палаузов wrote:
> > Exec=/usr/local/bin/valgrind --trace-children=yes --error-limit=no --
> > leak-check=full --show-leak-kinds=all --read-var-info=yes
> > /usr/local/bin/gnome-keyring-daemon --start --foreground --
> > components=secrets &>> /tmp/valgrind-gnome-keyring-daemon
> > 
> > does run under valgrind, but does not create /tmp/valgrind-gnome-
> > keyrind-gaemon.
> 
> Probably because this is not passed to a shell, so your application (gnome-
> keyring-daemon) is getting a "&>>" argument and that path.
> 
> Try valgrind's --log-file argument.
> 


More information about the dbus mailing list