Building 1.8.30 with USE_SYSTEMD=1 fails

I’m trying to upgrade from 1.5 to 1.8.30, and as I’m running HAProxy using systemd I’m trying to build it with USE_SYSTEMD=1 but the build keeps failing with this message:

GPARM=3 -DUSE_OPENSSL  -DUSE_SYSTEMD -DUSE_PCRE -I/usr/include  -DCONFIG_HAPROXY_VERSION=\"1.8.30-c248dab\" -DCONFIG_HAPROXY_DATE=\"2021/04/12\" \
      -DBUILD_TARGET='"linux-glibc"' \
      -DBUILD_ARCH='""' \
      -DBUILD_CPU='"generic"' \
      -DBUILD_CC='"gcc"' \
      -DBUILD_CFLAGS='"-O2 -g -fno-strict-aliasing -Wdeclaration-after-statement -fwrapv -Wno-unused-label"' \
      -DBUILD_OPTIONS='"USE_LINUX_TPROXY=1 USE_GETADDRINFO=1 USE_ZLIB=1 USE_POLL=default USE_REGPARM=1 USE_OPENSSL=1 USE_SYSTEMD=1 USE_PCRE=1"' \
       -c -o src/haproxy.o src/haproxy.c
src/haproxy.c:66:31: fatal error: systemd/sd-daemon.h: No such file or directory
 #include <systemd/sd-daemon.h>
                               ^
compilation terminated.
make: *** [src/haproxy.o] Error 1

I’m building HAProxy with this command:

sudo make TARGET=linux-glibc USE_LINUX_TPROXY=1 USE_GETADDRINFO=1 USE_ZLIB=1 USE_REGPARM=1 USE_OPENSSL=1 USE_PCRE=1 USE_SYSTEMD=1

Re :slight_smile:
looks like some devel package are missing.

Try installing systemd-devel.

That did it! Thanks