aboutsummaryrefslogtreecommitdiffstats
path: root/python/client_daemon.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/client_daemon.py')
-rw-r--r--python/client_daemon.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/client_daemon.py b/python/client_daemon.py
new file mode 100644
index 00000000..4384aa35
--- /dev/null
+++ b/python/client_daemon.py
@@ -0,0 +1,9 @@
+import sys
+import daemon
+import importlib
+from daemon.pidlockfile import TimeoutPIDLockFile
+pgr_name = sys.argv[0].split("_")[0]
+m = importlib.import_module(pgr_name)
+
+with daemon.DaemonContext(pidfile = TimeoutPIDLockFile('/var/run/{0}.pid'.format(pgr_name),10)):
+ m.run()