Merge pull request #449 from dwalton76/valgrind-enable

Add valgrind_enable option to /etc/frr/debian.conf
This commit is contained in:
Martin Winter 2017-05-08 16:32:42 +02:00 committed by GitHub
commit a9a65fbc6e
2 changed files with 15 additions and 1 deletions

View File

@ -19,3 +19,8 @@ eigrpd_options=" --daemon -A 127.0.0.1"
# The list of daemons to watch is automatically generated by the init script. # The list of daemons to watch is automatically generated by the init script.
watchfrr_enable=yes watchfrr_enable=yes
watchfrr_options=(-adz -r /usr/sbin/servicebBfrrbBrestartbB%s -s /usr/sbin/servicebBfrrbBstartbB%s -k /usr/sbin/servicebBfrrbBstopbB%s -b bB -t 30) watchfrr_options=(-adz -r /usr/sbin/servicebBfrrbBrestartbB%s -s /usr/sbin/servicebBfrrbBstartbB%s -k /usr/sbin/servicebBfrrbBstopbB%s -b bB -t 30)
# If valgrind_enable is 'yes' the frr daemons will be started via valgrind.
# The use case for doing so is tracking down memory leaks, etc in frr.
valgrind_enable=no
valgrind=/usr/bin/valgrind

View File

@ -150,6 +150,14 @@ start()
return; return;
fi fi
if [ $valgrind_enable = "yes" ]; then
${SSD} \
--start \
--pidfile=`pidfile $1` \
--exec $valgrind \
-- --trace-children=no --leak-check=full --log-file=/var/log/frr/$1-valgrind.log $D_PATH/$1 \
`eval echo "$""$1""_options"`
else
${SSD} \ ${SSD} \
--start \ --start \
--pidfile=`pidfile $1` \ --pidfile=`pidfile $1` \
@ -157,6 +165,7 @@ start()
-- \ -- \
`eval echo "$""$1""_options"` `eval echo "$""$1""_options"`
fi fi
fi
} }
# Stop the daemon given in the parameter, printing its name to the terminal. # Stop the daemon given in the parameter, printing its name to the terminal.