Writing portable code slows you down. With every change you have to think "hey is this available on all the other OSes too, and if not, how do I fallback?". This distracts you from your main goal, especially if that main goal can be better implemented with platform-specific APIs. I can very much understand not trying to bother and instead relying on contributors to port things to other OSes.
Is there anything wrong with lazy? Remember that people have limited time and man power.
There's a very good reason for using cgroups: to completely clean up a service's process tree even in the face of abusive behavior. A service can spawn a child process that calls setsid(). By using cgroups systemd can kill that child process too. Traditional POSIX APIs like killpg() do not allow that and give processes the ability to escape supervision.
You say FreeBSD's kernel APIs are superior. It makes me wonder why you think that. There are only two things that I think are better on FreeBSD than on Linux: kqueue is better than epoll, and the OpenBSD firewall is easier to learn than iptables. As for everything else I've yet to see hard evidence that FreeBSD beats Linux.
Answering "is this available on other OSes and how do I fall back?" is a good way to think through your algorithm and ensure that it makes sense.
Didn't know that about cgroups. Has anyone tried to kill a process tree on bsd or solaris and failed?
I don't know a lot about freebsd, most is just hearsay. I have been happier with their libc though, it seemed like it had fewer gotchas and unimplemented features.
Is there anything wrong with lazy? Remember that people have limited time and man power.
There's a very good reason for using cgroups: to completely clean up a service's process tree even in the face of abusive behavior. A service can spawn a child process that calls setsid(). By using cgroups systemd can kill that child process too. Traditional POSIX APIs like killpg() do not allow that and give processes the ability to escape supervision.
You say FreeBSD's kernel APIs are superior. It makes me wonder why you think that. There are only two things that I think are better on FreeBSD than on Linux: kqueue is better than epoll, and the OpenBSD firewall is easier to learn than iptables. As for everything else I've yet to see hard evidence that FreeBSD beats Linux.