Remove stale/conflicting pidfile by crwood · Pull Request #492 · gridsync/gridsync

This PR removes tahoe's "twistd.pid" in favor of using Gridsync's Supervisor for pidfile creation/management.

On non-Windows systems, Twisted/twistd will create its own pidfile ("twistd.pid") for tahoe processes and will refuse to (re)start tahoe if the pid number in the file matches any running process, irrespective of the name of that process. Gridsync's Supervisor, however, also creates/manages pidfiles for its processes (including on Windows!) but, unlike twistd, will include and check/verify the name of the process attached to the pid in the pidfile and determine staleness accordingly (i.e., by killing/restarting the process if the name actually corresponds to that of the process it is supposed to be managing, or by removing the pidfile if it does not). Removing "twistd.pid" (in favor of using Supervisor pidfiles) thus 1) avoids the situation in which tahoe will refuse to (re)start because a) it terminated uncleanly previously and b) some other process has since begun using the same pid contained in that pidfile and 2) allows Windows subprocesses to be managed in a way that is more consistent with the other operating systems supported by Gridsync.