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

here is the matching pull request