refactored init deamon script in buildfiles