When using "daemon --user foo", DAEMON_COREFILE_LIMIT doesn't affect the environment where the daemon to be started actually runs in; it works only without --user. Attached is a *very* lightly tested, somewhat crude patch which seems to fix it. I'm not enough a shell wizard to know for certain whether the patch would affect how the $* gets expanded in the runuser command line, so approach with caution.
Created attachment 117975 [details] Make DAEMON_COREFILE_LIMIT affect "daemon --user foo" invocations
Added, will be in 8.17-1.