Changed the demonize code, i had a problem with previous code when running deamonized, stat_db was getting written with stdout output (corupting it). Added upstart script to start deamon