pool_mgm requires /etc/haproxy directory in daemon mode

Bug #1135014 reported by Patrick Crews
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libra
Fix Released
Medium
David Shrewsbury

Bug Description

I see this error when running pool_mgm in daemon mode, but not with the -n argument.
The directory is not specified in any config file / it doesn't seem an obvious choice as the pool_mgm doesn't directly manipulate haproxy, but rather spins nodes and registers them with the api server.

Not necessarily a bug, but documenting this as it seems like odd behavior.

libra_pool_mgm -c /etc/libra.cfg
Traceback (most recent call last):
  File "/usr/local/bin/libra_pool_mgm", line 9, in <module>
    load_entry_point('libra==1.0', 'console_scripts', 'libra_pool_mgm')()
  File "/usr/local/lib/python2.7/dist-packages/libra-1.0-py2.7.egg/libra/mgm/mgm.py", line 448, in main
    with context:
  File "/usr/local/lib/python2.7/dist-packages/daemon/daemon.py", line 354, in __enter__
    self.open()
  File "/usr/local/lib/python2.7/dist-packages/daemon/daemon.py", line 329, in open
    change_working_directory(self.working_directory)
  File "/usr/local/lib/python2.7/dist-packages/daemon/daemon.py", line 477, in change_working_directory
    raise error
daemon.daemon.DaemonOSEnvironmentError: Unable to change working directory ([Errno 2] No such file or directory: '/etc/haproxy')

Revision history for this message
David Shrewsbury (dshrews) wrote :

Pool mgr should be setting a different working directory in mgm.py:

        context = daemon.DaemonContext(
            working_directory='/etc/haproxy',
            umask=0o022,
            pidfile=daemon.pidfile.TimeoutPIDLockFile(args.pid),
            files_preserve=[logger.handlers[0].stream]
        )

Changed in libra:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Andrew Hutchings (linuxjedi)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to libra (master)

Fix proposed to branch: master
Review: https://review.openstack.org/23458

Changed in libra:
assignee: Andrew Hutchings (linuxjedi) → David Shrewsbury (dshrews)
status: Triaged → In Progress
Changed in libra:
milestone: none → 2.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to libra (master)

Reviewed: https://review.openstack.org/23458
Committed: http://github.com/stackforge/libra/commit/f83aa28546a9ecb22e85b47554ac6bec6b1166c1
Submitter: Jenkins
Branch: master

commit f83aa28546a9ecb22e85b47554ac6bec6b1166c1
Author: David Shrewsbury <email address hidden>
Date: Mon Mar 4 15:19:56 2013 -0500

    Set pool mgr working directory to /.

    Copy-pasted code was attempting to set working directory
    to /etc/haproxy which may not exist.

    Fixes bug #1135014.

    Change-Id: I8e7aa6aab27a9294a8139674b65e1ecae189d100

Changed in libra:
status: In Progress → Fix Committed
Changed in libra:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to libra (release-v1)

Fix proposed to branch: release-v1
Review: https://review.openstack.org/23606

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: release-v1
Review: https://review.openstack.org/23694

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to libra (release-v1)

Reviewed: https://review.openstack.org/23694
Committed: http://github.com/stackforge/libra/commit/0a44c576e9a5691f0993b8fe7c54fa3ef1add7b9
Submitter: Jenkins
Branch: release-v1

commit 0a44c576e9a5691f0993b8fe7c54fa3ef1add7b9
Author: David Shrewsbury <email address hidden>
Date: Mon Mar 4 15:19:56 2013 -0500

    Set pool mgr working directory to /.

    Copy-pasted code was attempting to set working directory
    to /etc/haproxy which may not exist.

    Fixes bug #1135014.

    Change-Id: I2a42c3789a06d3e1d839ffb4c16c21c74ec05336

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.