| This is the whole service management for OpenBSD https://github.com/openbsd/src/blob/master/usr.sbin/rcctl/rc... Then you got the initialization script https://github.com/openbsd/src/blob/master/etc/rc Service file can be very small https://github.com/openbsd/src/blob/master/etc/rc.d/httpd Powered by https://github.com/openbsd/src/blob/master/etc/rc.d/rc.subr Also daemon(3) for running as a system service https://man.openbsd.org/daemon.3 And no need to track pid. It uses pgrep with the flags and the program name by default. I believe OpenRC does the same. https://github.com/openbsd/src/blob/f5d74fd467fccdfc60b450a7... |
For example, can it kill a runaway Apache process tree? Or safely confine the CGI scripts so that they don't cause the OOM killer to terminate the sshd?
And what happens if the "stop" command hangs indefinitely?
> And no need to track pid. It uses pgrep with the flags and the program name by default. I believe OpenRC does the same.
Facepalm.