Daemon implementation.