Giter Site home page Giter Site logo

Comments (5)

tianon avatar tianon commented on May 30, 2024

from haproxy.

jodawill avatar jodawill commented on May 30, 2024

The wrapper adds the (undocumented) -Ds flag to haproxy, which is specific to systemd.

from haproxy.

tianon avatar tianon commented on May 30, 2024

From https://manpages.debian.org/stretch/haproxy/haproxy.1.en.html:

-Ds

Start in systemd daemon mode, keeping a process in foreground.

Keeping a process in the foreground is exactly what we need -- they added it for systemd, because that's how one normally runs processes in systemd, but it's useful for Docker as well (because Docker requires that processes run in the same "foregrounded daemon" way). Even if we weren't using the haproxy-systemd-wrapper, we'd still be using -Ds.

Also, it's our entrypoint script which adds this, and only does so conditionally based on the intended command being simply haproxy, so it should be trivial to bypass at runtime. If you wanted something hacky, you could go as simple as something like the following: (as discussed over in #39)

$ docker run -dit haproxy bash -c 'syslogd -O /proc/1/fd/1 -S -D; exec haproxy -f /usr/local/etc/haproxy/haproxy.cfg -Ds'

from haproxy.

jodawill avatar jodawill commented on May 30, 2024

@tianon, thanks for the help. I've done some poking around and I see that haproxy seems to ignore signals unless you're using that wrapper. The thing I don't understand is why logging doesn't work when I start haproxy via the wrapper. I've tried adding syslogd -O /proc/1/fd/1 to the entrypoint script and it doesn't give me any logs. Is this a known bug, or is my configuration wrong somehow?

from haproxy.

tianon avatar tianon commented on May 30, 2024

Sorry for the delay -- that's a quirk of HAProxy: it will only log to syslog. I'm not sure why your starting syslogd didn't work, but there's more discussion of that over in #39.

Closing since the original question here seems to be resolved. 👍

from haproxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.