[abrt/f16] rhbz#749603 - abrt-ccpp not enabled when upgrading from F15 to F16

Nikola Pajkovsky npajkovs at fedoraproject.org
Wed Nov 2 13:46:15 UTC 2011


commit 7b75c9be44f0be6d48abee4e164179030385300b
Author: root <root at f16.(none)>
Date:   Wed Nov 2 14:16:55 2011 +0100

    rhbz#749603 - abrt-ccpp not enabled when upgrading from F15 to F16
    
    Signed-off-by: Nikola Pajkovsky <npajkovs at redhat.com>

 abrt.spec |   52 +++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 35 insertions(+), 17 deletions(-)
---
diff --git a/abrt.spec b/abrt.spec
index 34345d6..d14bbfa 100644
--- a/abrt.spec
+++ b/abrt.spec
@@ -254,9 +254,11 @@ getent passwd abrt >/dev/null || useradd --system -g abrt -u %{abrt_gid_uid} -d
 exit 0
 
 %post
+## [ $1 -eq 1 ] install section
 if [ $1 -eq 1 ]; then
 %if %{with systemd}
     # Enable (but don't start) the units by default
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
     /bin/systemctl enable abrtd.service >/dev/null 2>&1 || :
 %else
     /sbin/chkconfig --add abrtd
@@ -269,9 +271,11 @@ fi
 # because /cache/abrt-di/* was created under root with root:root
 # so 2.x fails when it tries to extract debuginfo there..
 chown -R abrt:abrt %{_localstatedir}/cache/abrt-di
+## [ $1 -eq 1 ] install section
 if [ $1 -eq 1 ]; then
 %if %{with systemd}
     # Enable (but don't start) the units by default
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
     /bin/systemctl enable abrt-ccpp.service >/dev/null 2>&1 || :
 %else
     /sbin/chkconfig --add abrt-ccpp
@@ -282,18 +286,26 @@ fi
 # that abrtd service is enabled and thus enable the new abrt-ccpp
 # service.  If abrtd is running on the system, run abrt-ccpp service
 # as well, because what was a part of abrtd became a separate service.
-if [ $1 -gt 1 ]; then # Is this an upgrade?
-   /sbin/chkconfig --add abrt-ccpp > /dev/null 2>&1 || :
-   /sbin/pidof abrtd >/dev/null 2>&1
-   if [ $? -eq 0 ]; then # Is abrtd running?
-      service abrt-ccpp restart >/dev/null 2>&1 || :
-   fi
+
+## [ $1 -gt 1 ] upgrade section
+if [ $1 -gt 1 ]; then
+   %if %{with systemd}
+       /bin/systemctl restart abrt-ccpp.service >/dev/null 2>&1 || :
+   %else
+       /sbin/chkconfig --add abrt-ccpp > /dev/null 2>&1 || :
+       /sbin/pidof abrtd >/dev/null 2>&1
+       if [ $? -eq 0 ]; then # Is abrtd running?
+           service abrt-ccpp restart >/dev/null 2>&1 || :
+       fi
+   %endif
 fi
 
 %post addon-kerneloops
+## [ $1 -eq 1 ] install section
 if [ $1 -eq 1 ]; then
 %if %{with systemd}
     # Enable (but don't start) the units by default
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
     /bin/systemctl enable abrt-oops.service >/dev/null 2>&1 || :
 %else
     /sbin/chkconfig --add abrt-oops
@@ -304,25 +316,31 @@ fi
 # that abrtd service is enabled and thus enable the new abrt-oops
 # service.  If abrtd is running on the system, run abrt-ccpp service
 # as well, because what was a part of abrtd became a separate service.
-if [ $1 -gt 1 ]; then # Is this an upgrade?
-   /sbin/chkconfig --add abrt-oops > /dev/null 2>&1 || :
-   /sbin/pidof abrtd >/dev/null 2>&1
-   if [ $? -eq 0 ]; then # Is abrtd running?
-      service abrt-oops restart >/dev/null 2>&1 || :
-   fi
+
+## [ $1 -gt 1 ] upgrade section
+if [ $1 -gt 1 ]; then
+   %if %{with systemd}
+       /bin/systemctl try-restart abrt-oops.service >/dev/null 2>&1 || :
+   %else
+       /sbin/chkconfig --add abrt-oops > /dev/null 2>&1 || :
+       /sbin/pidof abrtd >/dev/null 2>&1
+       if [ $? -eq 0 ]; then # Is abrtd running?
+	   service abrt-oops restart >/dev/null 2>&1 || :
+      fi
+  %endif
 fi
 
 %post addon-vmcore
 if [ $1 -eq 1 ]; then
 %if %{with systemd}
     # Enable (but don't start) the units by default
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
     /bin/systemctl enable abrt-vmcore.service >/dev/null 2>&1 || :
 %else
     /sbin/chkconfig --add abrt-vmcore
 %endif
 fi
 
-
 %preun
 if [ "$1" -eq "0" ] ; then
 %if %{with systemd}
@@ -369,16 +387,16 @@ fi
 
 %if %{with systemd}
 %postun
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+/bin/systemctl try-reload abrtd.service >/dev/null 2>&1 || :
 
 %postun addon-kerneloops
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+/bin/systemctl try-reload abrt-oops.service >/dev/null 2>&1 || :
 
 %postun addon-vmcore
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+/bin/systemctl try-reload abrt-vmcore.service >/dev/null 2>&1 || :
 
 %postun addon-ccpp
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+/bin/systemctl try-reload abrt-ccpp.service >/dev/null 2>&1 || :
 
 %endif
 


More information about the scm-commits mailing list