refactor for daemon running and shutdown
removed pid and pid filename to use shutdown
implemented shutdown