converted daemon starting to function