# Haproxy dead, but /var/run/haproxy.pid exists

**URL:** https://discourse.haproxy.org/t/haproxy-dead-but-var-run-haproxy-pid-exists/990
**Category:** Help!
**Created:** [February 6, 2017, 4:19pm UTC](https://discourse.haproxy.org/t/haproxy-dead-but-var-run-haproxy-pid-exists/990 "2017-02-06T16:19:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Jabba](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@Jabba](https://discourse.haproxy.org/u/Jabba)
#### Post date: [February 6, 2017, 4:19pm UTC](https://discourse.haproxy.org/t/haproxy-dead-but-var-run-haproxy-pid-exists/990/1 "2017-02-06T16:19:31Z")

</div>

Hi All,

i’m configuring a new haproxy as a smtp and http/s proxy.  
As a backend server i have 2 Kerio Connect email server.

all works good, but i have a strange behaviour of haproxy: after receive an email on port 25, haproxy dead.  
This is when i start haproxy:  
haproxy 17758 0.0 0.1 35192 1600 ? Ss 15:54 0:00 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -D -p /var/run/haproxy.pid  
root 17808 0.0 0.0 10432 672 pts/0 S+ 15:54 0:00 grep --color=auto haproxy

This is after an email on port 25  
root 17815 0.0 0.0 10432 672 pts/0 S+ 15:55 0:00 grep --color=auto haproxy

If i try to check the status with service haproxy status:  
haproxy dead, but /var/run/haproxy.pid exists.

# This is my haproxy conf

global  
log /dev/log local0  
log /dev/log local1 notice  
chroot /var/lib/haproxy  
stats socket /run/haproxy/admin.sock mode 660 level admin  
stats timeout 30s  
user haproxy  
group haproxy  
daemon

defaults  
mode tcp  
log global  
option tcplog  
option log-health-checks  
option dontlognull  
option allbackups  
#option forwardfor except 127.0.0.0/8  
option redispatch  
retries 3  
timeout connect 5000  
timeout client 50000  
timeout server 50000  
timeout check 10s  
maxconn 20000

frontend http  
mode http  
bind \*:80  
redirect location [https://kerio.cloud.com](https://kerio.cloud.com)

frontend https-in  
bind \*:443  
mode http  
option tcplog  
reqadd X-Forwarded-Proto:\ https  
default\_backend https-in

backend https-in  
mode http  
option ssl-hello-chk  
balance roundrobin  
stick-table type ip size 10M expire 30m  
stick on src  
cookie SERVERID insert indirect nocache  
server node02 [77.xxx.xxx.xxx:443](http://77.xxx.xxx.xxx:443) check cookie node02  
server node01 [77.xxx.xxx.xxx:443](http://77.xxx.xxx.xxx:443) check cookie node01  
frontend smtp-in  
bind 0.0.0.0:25  
mode tcp  
log global  
option tcplog  
default\_backend smtp\_outbound  
log-format {“type”:“haproxy”,“timestamp”:%Ts,“http\_status”:%ST,“http\_request”:"%ci",“bytes\_read”:%B,“upstream\_addr”:"%si",“backend\_name”:"%b",“retries”:%rc,“bytes\_uploaded”:%U,“upstream\_response\_time”:"%Tc",“session\_duration”:"%Tt",“termination\_state”:"%ts"}  
default\_backend smtp

backend smtp  
mode tcp  
log global  
balance roundrobin  
option smtpchk HELO [kerio.cloud.com](http://kerio.cloud.com)  
option redispatch  
server node02 [77.xxx.xxx.xxx:25555](http://77.xxx.xxx.xxx:25555) check  
server node01 [77.xxx.xxx.xxx:25555](http://77.xxx.xxx.xxx:25555) check

No error in haproxy.log or syslog.

Any idea ?

Thanks

---

<div class="post-metadata">

### Author: ![AaronWest](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/aaronwest/32/164_2.png) [@AaronWest](https://discourse.haproxy.org/u/AaronWest)
#### Post date: [February 7, 2017, 10:44am UTC](https://discourse.haproxy.org/t/haproxy-dead-but-var-run-haproxy-pid-exists/990/2 "2017-02-07T10:44:26Z")

</div>

I would expect to see something if it’s dying in the usual places like /var/log/messages or maybe dmesg output…

I’d suggest simplifying your config as your frontend “smtp-in” seems to mention two default\_backend’s “smtp\_outbound” and “smtp” but I don’t see any obvious reason for it. Not that I expect that to cause massive problems, it just reads as being odd.

What version of haproxy is it?

---

<div class="post-metadata">

### Author: ![Jabba](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@Jabba](https://discourse.haproxy.org/u/Jabba)
#### Post date: [February 7, 2017, 3:46pm UTC](https://discourse.haproxy.org/t/haproxy-dead-but-var-run-haproxy-pid-exists/990/3 "2017-02-07T15:46:20Z")

</div>

Thanks AaronWest.

i remove the 2° default backend…it’s was an error of cut and paste from older conf.  
This is my haproxy version

HA-Proxy version 1.6.4 2016/03/13

---

<div class="post-metadata">

### Author: ![Jabba](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@Jabba](https://discourse.haproxy.org/u/Jabba)
#### Post date: [February 7, 2017, 4:29pm UTC](https://discourse.haproxy.org/t/haproxy-dead-but-var-run-haproxy-pid-exists/990/4 "2017-02-07T16:29:29Z")

</div>

I found the error in /var/log/syslog

Feb 7 16:22:11 ip-172-31-3-109 kernel: [2845585.787066] haproxy[20076]: segfault at b8 ip 00007f061d9cc347 sp 00007ffd8c1f46b0 error 4 in haproxy[7f061d9a9000+f5000]
