determine the logic of daemon