Cocoa Hoto in real life (nprofile…k9rm) opal (nprofile…w8cy) if you or someone else might later be curious:
https://libslack.org/daemon/
https://libslack.org/daemon/sources/daemon.c
daemon.c depends on basic functions from https://libslack.org/
nor do i know how it's handling all those features you describe.
chroots
oh, it handles them just by literally calling it. the --chroot option just calls chroot(). changing users, chrooting, setting environment variables, redirecting logs, it just orchestrates those basic functions, does them in the right order, if you request them, and nothing much more.
custom environment variables
again, just convenience, -e adds an env var to the child's environment, because by default, raf daemon cleans up the environment for the child process. you can use -i to pass the entire external environment (all environment variables) to the child if you want, by i don't do usually.
separate tools in daemontools-style supervision
based indeed, but then comes the orchestration of those tools. daemon's man page basically just says: "There are many tasks that need to be performed to correctly set up a daemon process. This can be tedious. daemon performs these tasks for other processes." and that's the goal. it doesn't re-implement chroot(), it just calls it at the right time.
you say log files too; does it rely on a logrotate daemon?
each supervisor instance handles the output of its child, and sends it where you configure it to, either a syslog daemon, or to a log file. i just use plain log files for everything. and no, it doesn't rotate log files on its own, i use logrotate like a dirty whore :3
https://skarnet.org/software/s6/s6-log.html#diesyslogdiedie sums up issues
interesting read, thanks.