diff hgext/inotify/server.py @ 9897:97eda2133a9b stable

inotify: add a inotify.pidfile configuration possibility This will mainly help us in our tests to log pids of inotify servers started implicitely, to make sure that unkilled inotify daemons do not clutter the output of unrelated tests. Also desactivate the workaround introduced in 951ec6c7d703
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Tue, 17 Nov 2009 15:36:09 +0900
parents 95e1867f765b
children 8939900073a8
line wrap: on
line diff
--- a/hgext/inotify/server.py	Tue Nov 17 15:00:00 2009 +0900
+++ b/hgext/inotify/server.py	Tue Nov 17 15:36:09 2009 +0900
@@ -849,9 +849,14 @@
             finally:
                 self.master.shutdown()
 
-    runargs = None
     if 'inserve' not in sys.argv:
         runargs = [sys.argv[0], 'inserve', '-R', root]
+    else:
+        runargs = sys.argv[:]
+
+    pidfile = ui.config('inotify', 'pidfile')
+    if opts['daemon'] and pidfile is not None and 'pid-file' not in runargs:
+        runargs.append("--pid-file=%s" % pidfile)
 
     service = service()
     logfile = ui.config('inotify', 'log')