From f85fbd934bb2001122079da9e37e2fd1f9041a18 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 25 Jul 2015 16:57:21 -0700 Subject: [PATCH] main: write a PID file to pylink.pid --- .gitignore | 1 + main.py | 4 ++++ 2 files changed, 5 insertions(+) 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)