]> code.delx.au - offlineimap/commitdiff
Write current PID to ~/.offlineimap/pid
authorJohn Goerzen <jgoerzen@complete.org>
Sat, 7 Jul 2007 00:50:43 +0000 (01:50 +0100)
committerJohn Goerzen <jgoerzen@complete.org>
Sat, 7 Jul 2007 00:50:43 +0000 (01:50 +0100)
fixes deb#217550
refs deb#410181

offlineimap/init.py

index 3ff343e82a0ff4c5953fcf91a48c604a325ea68a..8d2df1207b4dc6c5b745d8d69fb52a1cfc680b94 100644 (file)
@@ -102,6 +102,13 @@ def startup(versionno):
 
     lock(config, ui)
 
+    try:
+        pidfd = open(config.getmetadatadir() + "/pid", "w")
+        pidfd.write(os.getpid())
+        pidfd.close()
+    except:
+        pass
+
     try:
         if options.has_key('-l'):
             sys.stderr = ui.logfile