Valgrind

From wiki.zmanda.com
Revision as of 20:58, 20 June 2006 by Paddy (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Amanda installation changes

  • Since valgrind don't support suexec program, the easiest way to run valgrind

is to configure amanda with '--with-user=root'

 ./configure --with-user=root ...
 make
 make install
  • Remove all setuid bit
 cd /install/path
 chmod u-s sbin/amcheck libexec/amcheck libexec/planner libexec/dumper libexec/runtar libexec/rundump
 dumpuser "root"
  • Changes to /etc/xinit.d/amanda
 user = root
  • Create a /root/.amandahosts with the line
 Amandaserver.FQDN root amdump amindexd amidxtaped
Running Amanda as superuser is not recommended.

Using valgrind

Amanda server

Simply prefix all your command with "valgrind "

 valgrind /path/to/amcheck <config>

This will simply analyze the program, not it's child.

For amdump you need --trace-children=yes

 valgrind --trace-children=yes /path/to/amdump <config>

Example: Following command line creates /tmp/xx.* file for each process:

 valgrind --log-file=/tmp/xx --num-callers=20 --leak-check=yes --leak-resolution=high --freelist-vol=100000000 --trace-children=yes

Amanda client

bsd, bsdudp, bsdtcp authentication

change to /etc/xinit.d/amanda

   server      = /usr/bin/valgrind
   server_args = --log-file=/tmp/yy --num-callers=20 --leak-check=yes --leak-resolution=high --trace-children=yes /path/to/amandad -auth=YOUR-AUTH amdump amindexd amidxtaped

= rsh authentication

In common-src/rsh-security.c (around line 248) Add

       "valgrind", "--log-file=/tmp/xx", "--num-callers=20", "--leak-check=yes", "--leak-resolution=high", "--trace-children=yes"

between rc-hostname and xamandad_path of the execlp call.

ssh authentication

In common-src/ssh-security.c (around line 260 and 265 - 2 places) Add

 "valgrind", "--log-file=/tmp/xx", "--num-callers=20", "--leak-check=yes", "--leak-resolution=high", "--trace-children=yes"

between rc-hostname and xamandad_path of the execlp call.