add log and baemon

fix daemon bug for darwin platform