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