This belief is mainly because after many years of debugging services, the very first thing I do is run the service outside of the daemon manager, with debugging enabled, so I can strace the process from its beginning.
This belief is mainly because after many years of debugging services, the very first thing I do is run the service outside of the daemon manager, with debugging enabled, so I can strace the process from its beginning.
https://mywiki.wooledge.org/ProcessManagement
Seems reasonable to me. Restarting processes is just something like this:
#!/bin/sh
# service.sh
while :; do
/my/service >> /var/log/service 2>&1
done
service.sh &
The service is just a normal program. If run directly, the inputs and outputs are attached to the terminal. If not, they're redirected to log files. Programs shouldn't care much what their outputs are connected to. Maybe they should turn off terminal escape codes in the outputs if they're not terminals but that's about it.It doesn't handle service dependencies. What if I only want my service to run when I'm on network and VPN is disabled?
And I can think of a lot more. All these things have been implemented in init, or in systemd, for decades.
It was just an example of how simple things can be when programs don't daemonize. Supervising and managing the processes is systemd's job and it does it well. Daemonizing makes its job harder and is not necessary to begin with.
inetd waited on "all" the sockets; when a connection came in, it started the configured application to deal with it.
daemonization didn't really figure into it, AFAIR.