This is what I do currently. If the file is present, but the daemon is not responding, the launcher tries killing the given pid, and then I removing the file. However, there is no way to distinguish whether the daemon is running (yet e.g. hung) or if it was killed, as in both cases the pidfile is present. And the point is that if it got killed (maybe even in a previous session), I cannot try killing that pid, because it can possibly be a completly other new process.
↧