adding status flag. removing duplicate code. removing rm for pidfile since start-stop-daemon removes it