a template of the cross-platform daemon implementation.