4 ms·
> 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 12
by jude- 12y ago
> 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.
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.
Code: https://github.com/jcnelson/runfs https://github.com/jcnelson/runfs
- jerven 12y agoNice to see a different solution than cgroups for this The Readme is rather sparse, could you add an example how to use it from a init shell script?