This is the same requirement systemd has for the "forking" type daemon.
This is the same requirement systemd has for the "forking" type daemon.
Looking through all the current init scripts, almost none of them do that. They launch the service executable, and report success it that succeeded. The service then often fork to place itself in the background, starts initialization, and might fail at that point without the init system noticing it.
The "forking" option of systemd will do the same, which is reasonable since a lot of existing services already works that way.
The apache init script on my system is one of the exceptions though, it doesn't directly launch apache, instead it starts apachectl, a program specifically written to start and interact with apache. That program communicates with apache, and therefore knows when it's started, whether it failed because httpd.conf had an error and so on.
That's not a general approach - unless you want to have each service accompanied by a program capable of doing IPC with the service for use with e.g. startup and shutdown. That'd make services portable among init systems and operating systems, so if you need that, it's a reasonable approach.
For systemd you'd can do the same, run apachectl to start apache.
Either the socket activation or notify approach don't need linking against a systemd library either they can just be done in < 20 lines of code.
The thread we're on is talking about a public API that's not documented sufficiently for alternative implementations to be created without reading its source code.