@cryptotaxi247 / netdata-1 / commits / 01783629b

fix for debug mode

Costa Tsaousis (ktsaou) committed Apr 27, 2014 at 16:07 UTC 01783629b4b85abda011aa1b35d9d9f38f9b16dd
1 file changed +11 -2
netdata.start
+11 -2
@@ -36,10 +36,19 @@ then
36
37 mv netdata.conf netdata.conf.old
38 echo "You are having an old config. Moved to netdata.conf.old"
39 + else
40 + # find if debug is enabled in the config
41 + df=`grep -C 3 "\[debug\]" netdata.conf | grep "flags" | tail -n 1 | cut -d '=' -f 2 | sed s"/ //g"`
42 + if [ -z "$df" -o "$df" = "0x00000000" ]
43 + then
44 + NETDATA_CONFIG_DEBUG=0
45 + else
46 + NETDATA_CONFIG_DEBUG=1
47 + fi
48 fi
49 fi
50
42 -echo "Compiling netdata"
51 +echo "Compiling netdata (debug=$NETDATA_CONFIG_DEBUG)"
52 if [ $NETDATA_CONFIG_DEBUG -eq 1 ]
53 then
54 ulimit -c unlimited
@@ -47,7 +56,7 @@ then
56 debug_opts="-df 0xfffffadf -dl netdata.log"
57 else
58 gcc -Wall -O3 -o netdata netdata.c -lpthread -lz || exit 1
50 - debug_opts=
59 + debug_opts="-df 0x00000000"
60 fi
61
62 echo "Stopping a (possibly) running netdata..."