Assume server with lots of processes.
Service A starts writes PID to disk, lets say 123. lots of processes start and stop as it goes along and does its work. Service A crashes/stops working PID 123 gets reused by a new process SysAdmin comes and hits /etc/init.d/ServiceA restart shell script calls kill 123 which was a totally different process now not at all related to ServiceA.
etc...
Clean unmounting not depending on timeouts to be high enough.
etc...
Not starting a database before the filesystem with the database files is mounted.
etc...
I created a specialized FUSE filesystem to deal with this. Processes create PID files in it, but when they die, the filesystem automatically removes them.
The Readme is rather sparse, could you add an example how to use it from a init shell script?
Although the Capsicum model (in FreeBSD, slowly getting into Linux) where you can have file descriptors for processes is another different model.
This was solved decades ago with numbered init symlinks:
K20postgresql
S20postgresqlSo I would say it has been hacked around for decades. Not cleanly solved. But I am not the best informed here so please add more details about how numbered init symlinks guarantee file system being there before a service is started.
Honest question: I've been using sysvinit for a very long time and I have no concept of what those bugs might be.