From 6a12af1242af64825d8d2f97516bd4eb183b82a7 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 12 Feb 2020 13:20:08 -0500 Subject: [PATCH] Remove non-root for older distributions Older systemd does not support capabilities. For such a platform, disable non-root mode. --- confluent_server/confluent_server.spec.tmpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/confluent_server/confluent_server.spec.tmpl b/confluent_server/confluent_server.spec.tmpl index 1306fb5f..6cab3a7f 100644 --- a/confluent_server/confluent_server.spec.tmpl +++ b/confluent_server/confluent_server.spec.tmpl @@ -46,6 +46,8 @@ grep -v confluent/__init__.py INSTALLED_FILES.bare | grep -v etc/init.d/confluen rm $RPM_BUILD_ROOT/etc/init.d/confluent rmdir $RPM_BUILD_ROOT/etc/init.d rmdir $RPM_BUILD_ROOT/etc +# Only do non-root confluent if systemd of the platform supports it +systemd-analyze verify $RPM_BUILD_ROOT/usr/lib/systemd/system/confluent.service 2>&1 | grep "'AmbientCapabilities'" > /dev/null && sed -e 's/User=.*//' -e 's/Group=.*//' -e 's/AmbientCapabilities=.*//' -i $RPM_BUILD_ROOT/usr/lib/systemd/system/confluent.service cat INSTALLED_FILES %triggerin -- python-pyghmi, python3-pyghmi, python2-pyghmi