diff --git a/.gitignore b/.gitignore index a63d5b5..a4918e7 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ __pycache__/ *~ *.save* *.db +pylink.pid diff --git a/main.py b/main.py index 5db0098..9f35987 100755 --- a/main.py +++ b/main.py @@ -204,6 +204,10 @@ if __name__ == '__main__': sys.exit(2) protocols_folder = [os.path.join(os.getcwd(), 'protocols')] + # Write a PID file. + with open('pylink.pid', 'w') as f: + f.write(str(os.getpid())) + # Import plugins first globally, because they can listen for events # that happen before the connection phase. utils.plugins.append(coreplugin)