Domanda

I use start-stop-daemon to start up programs and would like to use it together with Valgrind.

This is how I use start-stop-daemon:

start-stop-daemon --start --background --exec ${BINPATH}/myPgm -- myPgm

This is how I use Valgrind on a standalone application (junk):

valgrind --tool=memcheck --leak-check=yes ./junk

and that works.

I would want to do something like:

start-stop-daemon --start --background --exec valgrind --tool=memcheck --leak-check=yes --log-file=/usr/magnus/logFile ${BINPATH}/myPgm -- myPgm

It seems start-stop-daemon accepts valgrind (if I only have valgrind without it's flags --tool=memcheck --leak-check=yes --log-file=/usr/magnus/logFile it seem to be accepted) but start-stop-daemon won't accept it.

I get start-stop-daemon: unrecognized option '--tool=memcheck' for the valgrind flags.

Does anybody know how this can be done?

È stato utile?

Soluzione

The "--" in there is used to separate start-stop-daemon's arguments from the ones passed to your executable. So, the myPgm you have after "--" is actually supplied as an argument to your myPgm executable. I think it's extraneous in your first example.

You need to use "--" to split valgrind's args out, like this:

start-stop-daemon --start --background --exec valgrind -- --tool=memcheck --leak-check=yes --log-file=/usr/magnus/logFile ${BINPATH}/myPgm
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top