# Reloading with expose-fd and multiple sockets?

**URL:** <https://discourse.haproxy.org/t/reloading-with-expose-fd-and-multiple-sockets/1926>\
**Category:** Help!\
**Created:** [December 21, 2017, 5:29pm UTC](https://discourse.haproxy.org/t/reloading-with-expose-fd-and-multiple-sockets/1926 "2017-12-21T17:29:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsumners](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/jsumners/32/358_2.png) [@jsumners](https://discourse.haproxy.org/u/jsumners)\
**Post date:** [December 21, 2017, 5:29pm UTC](https://discourse.haproxy.org/t/reloading-with-expose-fd-and-multiple-sockets/1926/1 "2017-12-21T17:29:39Z")

</div>

I am updating [https://github.com/jsumners/haproxy-rhel7](https://github.com/jsumners/haproxy-rhel7) and want to provide seamless reloads in the default configuration. I am unclear about reloading with multiple stats sockets. Let’s assume we have two stats sockets `/run/haproxy.sock1` and `/run/haproxy.sock2`. Would we do the following for a reload?

```auto
> haproxy -c -f /etc/haproxy.cfg -q -x /run/haproxy.sock1 -x /run/haproxy.sock2
> kill -USR2 $(cat /run/haproxy.pid)

```

Or do we only have to specify the first socket?

Additionally, the documentation suggests using `-sf $(cat /run/haproxy.pid)` for gracefully terminating old processes. I do not know if this is possible with systemd (without a custom startup script). Will `-sf` simply read a file specified without having to `cat` it?

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [December 24, 2017, 1:51pm UTC](https://discourse.haproxy.org/t/reloading-with-expose-fd-and-multiple-sockets/1926/2 "2017-12-24T13:51:27Z")

</div>

I don’t see why you would need multiple stats sockets. 1 socket should suffice.

> [@jsumners](#):
>
> Additionally, the documentation suggests using -sf $(cat /run/haproxy.pid) for gracefully terminating old processes. I do not know if this is possible with systemd (without a custom startup script). Will -sf simply read a file specified without having to cat it?

Please use the contributed systemd unit file in:  
`contrib/systemd/haproxy.service.in`

[http://git.haproxy.org/?p=haproxy-1.8.git;a=blob;f=contrib/systemd/haproxy.service.in](http://git.haproxy.org/?p=haproxy-1.8.git;a=blob;f=contrib/systemd/haproxy.service.in)

You still have to adjust it for seamless reloads, but that would be a minor change I guess:

[https://cbonte.github.io/haproxy-dconv/1.8/management.html#3](https://cbonte.github.io/haproxy-dconv/1.8/management.html#3)  
[https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#5.1-expose-fd%20listeners](https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#5.1-expose-fd%20listeners)

---

<div class="post-metadata">

**Author:** ![jsumners](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/jsumners/32/358_2.png) [@jsumners](https://discourse.haproxy.org/u/jsumners)\
**Post date:** [January 2, 2018, 5:48pm UTC](https://discourse.haproxy.org/t/reloading-with-expose-fd-and-multiple-sockets/1926/3 "2018-01-02T17:48:22Z")

</div>

I appreciate you taking time to respond, but I’m having a difficult time seeing any answers in your response. When running multiple instances via `nbproc` one should have a corresponding socket for each process, unless I am mistaken. And I do know where the documentation is located. My questions stem directly from reading the documentation. It is not clear on the subject of these questions.

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [January 2, 2018, 7:17pm UTC](https://discourse.haproxy.org/t/reloading-with-expose-fd-and-multiple-sockets/1926/4 "2018-01-02T19:17:44Z")

</div>

You only mentioned multiple stats sockets in your first post, not nbproc/multiprocess mode.

I don’t see how multiprocess mode would work with seamless reloads, no, that’s not supported.

---

<div class="post-metadata">

**Author:** ![jsumners](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/jsumners/32/358_2.png) [@jsumners](https://discourse.haproxy.org/u/jsumners)\
**Post date:** [January 2, 2018, 8:00pm UTC](https://discourse.haproxy.org/t/reloading-with-expose-fd-and-multiple-sockets/1926/5 "2018-01-02T20:00:44Z")

</div>

I thought it would be implied since there is no reason to have multiple sockets otherwise.
