Separate merger/server pidfile/logging better

So that they may safely coexist on a single host.

Change-Id: I64698423670bf11051c40ad80427643dd0f3d0cd
This commit is contained in:
James E. Blair 2014-02-17 08:32:07 -08:00
parent 4076e2b432
commit a443013be1
2 changed files with 14 additions and 6 deletions

View File

@ -87,11 +87,11 @@ zuul
``layout_config=/etc/zuul/layout.yaml``
**log_config**
Path to log config file. Used by all Zuul commands.
Path to log config file. Used by zuul-server only.
``log_config=/etc/zuul/logging.yaml``
**pidfile**
Path to PID lock file. Used by all Zuul commands.
Path to PID lock file. Used by zuul-server only.
``pidfile=/var/run/zuul/zuul.pid``
**state_dir**
@ -143,6 +143,14 @@ merger
"http://zuul.example.com/p" or "http://zuul-merger01.example.com/p"
depending on whether the merger is co-located with the Zuul server.
**log_config**
Path to log config file for the merger process.
``log_config=/etc/zuul/logging.yaml``
**pidfile**
Path to PID lock file for the merger process.
``pidfile=/var/run/zuul-merger/merger.pid``
smtp
""""

View File

@ -94,7 +94,7 @@ class Merger(object):
# See comment at top of file about zuul imports
import zuul.merger.server
self.setup_logging('zuul', 'log_config')
self.setup_logging('merger', 'log_config')
self.merger = zuul.merger.server.MergeServer(self.config)
self.merger.start()
@ -135,10 +135,10 @@ def main():
print
raise
if server.config.has_option('zuul', 'pidfile'):
pid_fn = os.path.expanduser(server.config.get('zuul', 'pidfile'))
if server.config.has_option('merger', 'pidfile'):
pid_fn = os.path.expanduser(server.config.get('merger', 'pidfile'))
else:
pid_fn = '/var/run/zuul/merger.pid'
pid_fn = '/var/run/zuul-merger/merger.pid'
pid = pid_file_module.TimeoutPIDLockFile(pid_fn, 10)
if server.args.nodaemon: