This is mostly the same as OpenBSD commit b4e4f16f2ae0ddf1e786bb12c99b8c51170a1a33
- Use a stop event to terminate the dispatch loop. - Report to the services manager that the service can be stopped or shut-down while it is running. CORE-14390