app-admin/collectd: Fix pkg_postinst...
authorThomas Deutschmann <whissi@gentoo.org>
Fri, 30 Mar 2018 23:26:49 +0000 (01:26 +0200)
committerThomas Deutschmann <whissi@gentoo.org>
Fri, 30 Mar 2018 23:27:22 +0000 (01:27 +0200)
...to support systemd's new rootprefix.

Closes: https://bugs.gentoo.org/596852
Package-Manager: Portage-2.3.26, Repoman-2.3.7
RepoMan-Options: --force

app-admin/collectd/collectd-5.7.2-r2.ebuild [moved from app-admin/collectd/collectd-5.7.2-r1.ebuild with 98% similarity]

similarity index 98%
rename from app-admin/collectd/collectd-5.7.2-r1.ebuild
rename to app-admin/collectd/collectd-5.7.2-r2.ebuild
index aa1d44699653c72923a728dd42449fe3b7e3eddd..9adfa6322e16c7975112b459fb9e6fa734d9f928 100644 (file)
@@ -500,7 +500,7 @@ pkg_postinst() {
                        elog "  ${caps_str}+EP"
                        elog
 
-                       local systemd_unit="${EROOT}usr/lib/systemd/system/collectd.service"
+                       local systemd_unit="$(systemd_get_systemunitdir)/collectd.service"
                        if [[ -e "${systemd_unit}" ]]; then
                                caps_str="${caps[*]}"
                                sed -i -e "s:^CapabilityBoundingSet=.*:CapabilityBoundingSet=${caps_str}:" "${systemd_unit}" || \
@@ -509,6 +509,12 @@ pkg_postinst() {
                                elog "CapabilityBoundingSet in '${systemd_unit}'"
                                elog "updated to match capabilities set above."
                                elog
+                       else
+                               if has_version "sys-apps/systemd"; then
+                                       # Bug 596852
+                                       ewarn "Failed to update CapabilityBondingSet in '${systemd_unit}'"
+                                       ewarn "because unit was not found. Please file a bug about this."
+                               fi
                        fi
                fi
        fi