# Problem installing HAProxy

**URL:** <https://discourse.haproxy.org/t/problem-installing-haproxy/6024>\
**Category:** Help!\
**Created:** [December 14, 2020, 10:34am UTC](https://discourse.haproxy.org/t/problem-installing-haproxy/6024 "2020-12-14T10:34:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gigazo1d](https://avatars.discourse-cdn.com/v4/letter/g/7ea924/32.png) [@Gigazo1d](https://discourse.haproxy.org/u/Gigazo1d)\
**Post date:** [December 14, 2020, 10:34am UTC](https://discourse.haproxy.org/t/problem-installing-haproxy/6024/1 "2020-12-14T10:34:56Z")

</div>

Hi! Installing HAProxy v.2.3 on Ububntu:  
make TARGET = linux-glibc  
sudo make install

Installation log:

```
'haproxy' -> '/usr/local/sbin/haproxy'
install: creating directory '/usr/local/share/man/man1'
'doc/haproxy.1' -> '/usr/local/share/man/man1/haproxy.1'
install: creating directory '/usr/local/doc'
install: creating directory '/usr/local/doc/haproxy'
'doc/configuration.txt' -> '/usr/local/doc/haproxy/configuration.txt'
'doc/management.txt' -> '/usr/local/doc/haproxy/management.txt'
'doc/proxy-protocol.txt' -> '/usr/local/doc/haproxy/proxy-protocol.txt'
'doc/seamless_reload.txt' -> '/usr/local/doc/haproxy/seamless_reload.txt'
'doc/architecture.txt' -> '/usr/local/doc/haproxy/architecture.txt'
'doc/peers-v2.0.txt' -> '/usr/local/doc/haproxy/peers-v2.0.txt'
'doc/regression-testing.txt' -> '/usr/local/doc/haproxy/regression-testing.txt'
'doc/cookie-options.txt' -> '/usr/local/doc/haproxy/cookie-options.txt'
'doc/lua.txt' -> '/usr/local/doc/haproxy/lua.txt'
'doc/WURFL-device-detection.txt' -> '/usr/local/doc/haproxy/WURFL-device-detection.txt'
'doc/linux-syn-cookies.txt' -> '/usr/local/doc/haproxy/linux-syn-cookies.txt'
'doc/SOCKS4.protocol.txt' -> '/usr/local/doc/haproxy/SOCKS4.protocol.txt'
'doc/network-namespaces.txt' -> '/usr/local/doc/haproxy/network-namespaces.txt'
'doc/DeviceAtlas-device-detection.txt' -> '/usr/local/doc/haproxy/DeviceAtlas-device-detection.txt'
'doc/51Degrees-device-detection.txt' -> '/usr/local/doc/haproxy/51Degrees-device-detection.txt'
'doc/netscaler-client-ip-insertion-protocol.txt' -> '/usr/local/doc/haproxy/netscaler-client-ip-insertion-protocol.txt'
'doc/peers.txt' -> '/usr/local/doc/haproxy/peers.txt'
'doc/close-options.txt' -> '/usr/local/doc/haproxy/close-options.txt'
'doc/SPOE.txt' -> '/usr/local/doc/haproxy/SPOE.txt'
'doc/intro.txt' -> '/usr/local/doc/haproxy/intro.txt'

```

Config is correct:

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

        # Default SSL material locations
# ca-base /etc/ssl/certs
# crt-base /etc/ssl/private

        # Default ciphers to use on SSL-enabled listening sockets.
        # For more information, see ciphers(1SSL). This list is from:
        # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
        # An alternative list with additional directives can be obtained from
        # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
# ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS
# ssl-default-bind-options no-sslv3
        ## Add the line below
# tune.ssl.default-dh-param 2048

defaults
        log global
        mode http
        option httplog
        option dontlognull
        timeout connect 5000
        timeout client 50000
        timeout client 50000
        timeout server 50000
# errorfile 400 /etc/haproxy/errors/400.http
# errorfile 403 /etc/haproxy/errors/403.http
# errorfile 408 /etc/haproxy/errors/408.http
# errorfile 500 /etc/haproxy/errors/500.http
# errorfile 502 /etc/haproxy/errors/502.http
# errorfile 503 /etc/haproxy/errors/503.http
# errorfile 504 /etc/haproxy/errors/504.http
frontend http
    bind *:8000
    default_backend servers

backend servers
    server server 127.0.0.1:81

```

Startup error:

```
systemd[1]: haproxy.service: Can't open PID file /var/run/haproxy.pid (yet?) after start: No such file or directory
Dec 14 10:31:48 hapserv systemd[1]: haproxy.service: Failed with result 'protocol'.
Dec 14 10:31:48 hapserv systemd[1]: Failed to start SYSV: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments..

```

Please help with the problem

---

<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 14, 2020, 11:00am UTC](https://discourse.haproxy.org/t/problem-installing-haproxy/6024/2 "2020-12-14T11:00:16Z")

</div>

Starting up how? What was the procedure that you used to install the systemd unit?

Please show the output of `systemctl status haproxy` as well as `cat` the entire systemd unit file.

---

<div class="post-metadata">

**Author:** ![Gigazo1d](https://avatars.discourse-cdn.com/v4/letter/g/7ea924/32.png) [@Gigazo1d](https://discourse.haproxy.org/u/Gigazo1d)\
**Post date:** [December 14, 2020, 11:45am UTC](https://discourse.haproxy.org/t/problem-installing-haproxy/6024/3 "2020-12-14T11:45:14Z")

</div>

> [@lukastribus](#):
>
> Starting up how?

systemctl start haproxy

> [@lukastribus](#):
>
> What was the procedure that you used to install the systemd unit?

nothing

> [@lukastribus](#):
>
> Please show the output of `systemctl status haproxy`

```
hapuser@hap_server:~$ sudo systemctl status haproxy
● haproxy.service - SYSV: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments.
   Loaded: loaded (/etc/init.d/haproxy; generated)
   Active: failed (Result: protocol) since Mon 2020-12-14 11:32:56 UTC; 39s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1742 ExecStart=/etc/init.d/haproxy start (code=exited, status=0/SUCCESS)

Dec 14 11:32:56 hap_server systemd[1]: Starting SYSV: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments....
Dec 14 11:32:56 hap_server systemd[1]: haproxy.service: Can't open PID file /var/run/haproxy.pid (yet?) after start: No such file or directory
Dec 14 11:32:56 hap_server systemd[1]: haproxy.service: Failed with result 'protocol'.
Dec 14 11:32:56 hap_server systemd[1]: Failed to start SYSV: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments..

```

> [@lukastribus](#):
>
> as well as `cat` the entire systemd unit file

```
Dec 14 11:43:10 hap_server sudo[2016]: pam_unix(sudo:session): session closed for user root
Dec 14 11:43:34 hap_server sudo[2035]: hapuser : TTY=tty1 ; PWD=/home/hapuser ; USER=root ; COMMAND=/bin/systemctl restart haproxy
Dec 14 11:43:34 hap_server sudo[2035]: pam_unix(sudo:session): session opened for user root by hapuser(uid=0)
Dec 14 11:43:34 hap_server systemd[1]: Starting SYSV: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments....
Dec 14 11:43:34 hap_server systemd[1]: haproxy.service: Can't open PID file /var/run/haproxy.pid (yet?) after start: No such file or directory
Dec 14 11:43:34 hap_server systemd[1]: haproxy.service: Failed with result 'protocol'.
Dec 14 11:43:34 hap_server systemd[1]: Failed to start SYSV: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments..

```

---

<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 14, 2020, 1:18pm UTC](https://discourse.haproxy.org/t/problem-installing-haproxy/6024/4 "2020-12-14T13:18:41Z")

</div>

> [@Gigazo1d](#):
>
> nothing

Then you do not have a consistent installation. This init.d file is probably from an old installation that has not been properly removed. Now you have an old startup script, a new executable which won’t work.

Refer to the following post to fix your startup script issue:

> [@Failing to start with systemd and unexplained issues](https://discourse.haproxy.org/t/failing-to-start-with-systemd-and-unexplained-issues/849/4):
>
> Do not use the init.d file. You are using systemd, you have use the systemd unit file and wrapper, not the init.d script. rm /etc/init.d/haproxy cd contrib/systemd cp haproxy.service.in /lib/systemd/system/ systemctl daemon-reload systemctl enable haproxy systemctl start haproxy systemctl status haproxy Note: Haproxy 1.8 and later needs to be compiled with USE\_SYSTEMD=1 for the provided systemd unit file to work (needs systemd header files, that would be libsystemd-dev on Debian/Ubuntu or sys…
