commit:     a31f6aab2671f7cea5d96ff7ca0410bc82df27f4
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 30 23:26:49 2018 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Fri Mar 30 23:27:22 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a31f6aab

app-admin/collectd: Fix pkg_postinst...

...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

 .../{collectd-5.7.2-r1.ebuild => collectd-5.7.2-r2.ebuild}        | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/app-admin/collectd/collectd-5.7.2-r1.ebuild 
b/app-admin/collectd/collectd-5.7.2-r2.ebuild
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 aa1d4469965..9adfa6322e1 100644
--- a/app-admin/collectd/collectd-5.7.2-r1.ebuild
+++ b/app-admin/collectd/collectd-5.7.2-r2.ebuild
@@ -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

Reply via email to