[patch] a slightly different way to deal with multiple instances
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GTG |
Fix Released
|
Low
|
François Boulogne |
Bug Description
Hi,
When GTG exits, the pidfile (gtg.pid) is not deleted. Looking closer to the code, I saw GTG checked (if pidfile exists which is often the case since gtg.pid is not deleted) if the process is still running or not (via ps command).
I thinks this could be improved easily. First, one can avoid to check running processes in most of the case if the pidfile is deleted when the software stops. This could be done with two lines of codes (see path).
Actually, in the patch, I also suggest a different way to check is the process is still running. Currently, GTG uses the command "ps" to handle that. This is not necessary bacause it is easy to read /proc (this is what ps do, btw)
In the current code, both PID and command are checked. In my patch, I just check the existence of the process (PID). If you think it is worth to analyse the command too, /proc/PID/cmdline could be read to do so.
It does not improve loading time so much, but the code is a bit smarter IMHO.
Changed in gtg: | |
status: | Fix Committed → Fix Released |
I agree that this is a small but nice to have improvement