In general I do like this pattern, though: if you have a daemon which needs to be root for some reason, fork into a second process that keeps root, setuid the main process to non-root, and use a Unix socketpair to provide a small API surface for the non-root process to use to ask the root process to perform privileged operations
https://git.sr.ht/~sircmpwn/digitd/tree/master/item/cmd/digitd/root.ha