3 ms·
to me it would have been simpler to wrap the program in a small shellscript or something, e.g. #!/bin/sh exec valgrind --log-file=/tmp/valgrind.%p.log
by zokier 2y ago
to me it would have been simpler to wrap the program in a small shellscript or something, e.g.
#!/bin/sh
exec valgrind --log-file=/tmp/valgrind.%p.log /path/to/my/app
and have the web server execute that instead of the original executable
- mananaysiempre 2y agoBeing able to repeat the experiment at your leisure without digging through web server logs is valuable. Still, a shell script does indeed sound like the way to go: `set` should already dump the environment as required here, and then you can exec your CGI program. (Unfortunately, it doesn’t in bash; `set -o posix` first to fix that.)