Basic daemon template extended, it now looks like this should work.