From 4911de81e6866cc945c665b00fb0bad893e9dd8c Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 13 May 2014 10:59:41 -0400 Subject: [PATCH] Have confluent automatically set up /var/run/confluent if permitted If wanting to run as non-root, mkdir -p /var/run/confluent /var/log/confluent /etc/confluent and chown those to be owned by confluent user. That is probably path for deb and rpm packaging. --- TODO | 4 +++- confluent_server/confluent/main.py | 8 +++++++- confluent_server/setup.py | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index 89025569..13d09bdb 100644 --- a/TODO +++ b/TODO @@ -31,4 +31,6 @@ KeyError: '' a titlebar -audit log did not show confetty activity for starting console -read exclusive and full exclusive console access modes --invalid attributes at create time come out as 500 +-when an http session exists, confluent cpu usage on my vm idles at 2 %. + profile exactly what is spinning and try to make it nicer +- an ipmi console was once stuck in 'connecting' state, no idea how \ No newline at end of file diff --git a/confluent_server/confluent/main.py b/confluent_server/confluent/main.py index e99d58a0..54fa4c68 100644 --- a/confluent_server/confluent/main.py +++ b/confluent_server/confluent/main.py @@ -80,7 +80,13 @@ def _checkpidfile(): fcntl.flock(pidfile, fcntl.LOCK_UN) pidfile.close() except IOError: - pidfile = open('/var/run/confluent/pid', 'w') + try: + pidfile = open('/var/run/confluent/pid', 'w') + except IOError as e: + if e.errno != 2: + raise + os.makedirs('/var/run/confluent') + pidfile = open('/var/run/confluent/pid', 'w') fcntl.flock(pidfile, fcntl.LOCK_EX) pidfile.write(str(os.getpid())) fcntl.flock(pidfile, fcntl.LOCK_UN) diff --git a/confluent_server/setup.py b/confluent_server/setup.py index ce6cb75c..cd292077 100644 --- a/confluent_server/setup.py +++ b/confluent_server/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name='confluent_server', - version='0.1.3', + version='0.1.5', author='Jarrod Johnson', author_email='jbjohnso@us.ibm.com', url='http://xcat.sf.net/',