From e85878d8020592f7e0b447981afebde4bd7ace28 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Mon, 28 Apr 2014 13:46:20 +0000 Subject: [PATCH] Use process name instead of pid for fedmsg monitoring socket filename. --- roles/fedmsg/base/templates/base.py.j2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/fedmsg/base/templates/base.py.j2 b/roles/fedmsg/base/templates/base.py.j2 index b55b48c966..3eee0644ac 100644 --- a/roles/fedmsg/base/templates/base.py.j2 +++ b/roles/fedmsg/base/templates/base.py.j2 @@ -1,4 +1,8 @@ import os +import psutil + +pid = os.getpid() +proc = [p for p in psutil.process_iter() if p.pid == pid][0] config = dict( # Set this to dev if you're hacking on fedmsg or an app locally. @@ -47,4 +51,4 @@ config = dict( zmq_tcp_keepalive_intvl=5, ) # This option adds an IPC socket by which we can monitor hub health. -config['moksha.monitoring.socket'] = 'ipc:///var/run/fedmsg/monitoring-%i.socket' % os.getpid() +config['moksha.monitoring.socket'] = 'ipc:///var/run/fedmsg/monitoring-%s.socket' % proc.name