Skip to content

Commit

Permalink
Use systemd/sd-daemon.h headers for systemd presence
Browse files Browse the repository at this point in the history
Finding systemd devel packages using libsystemd does not work as
in RHEL based distro the package name is systemd-devel and for
deb/ubunutu it is libsystemd. It is also giving false result when
podman rpm is built with systemd but hack/systemd_tag.sh does not
return anything.

Install systemd-devel package in build_rpm.sh script

Moving to systemd/sd-daemon.h header files which comes from devel
packages fixes the issue.

Signed-off-by: Chandan Kumar (raukadah) <raukadah@gmail.com>
  • Loading branch information
raukadah committed Dec 16, 2019
1 parent 6c7b6d9 commit b54c350
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -45,7 +45,7 @@ endif
ifeq (,$(findstring systemd,$(BUILDTAGS)))
$(warning \
Podman is being compiled without the systemd build tag.\
Install libsystemd for journald support)
Install libsystemd on Ubuntu or systemd-devel on rpm based distro for journald support)
endif

BUILDTAGS_CROSS ?= containers_image_openpgp exclude_graphdriver_btrfs exclude_graphdriver_devicemapper exclude_graphdriver_overlay
Expand Down
1 change: 1 addition & 0 deletions contrib/build_rpm.sh
Expand Up @@ -26,6 +26,7 @@ declare -a PKGS=(device-mapper-devel \
make \
rpm-build \
go-compilers-golang-compiler \
systemd-devel \
)

if [[ $pkg_manager == *dnf ]]; then
Expand Down
7 changes: 5 additions & 2 deletions hack/systemd_tag.sh
@@ -1,4 +1,7 @@
#!/usr/bin/env bash
if pkg-config --exists libsystemd; then
echo systemd
cc -E - > /dev/null 2> /dev/null << EOF
#include <systemd/sd-daemon.h>
EOF
if test $? -eq 0 ; then
echo systemd
fi

0 comments on commit b54c350

Please sign in to comment.