diff --git a/dbus-broker.spec b/dbus-broker.spec index bfe688b..d7cc02f 100644 --- a/dbus-broker.spec +++ b/dbus-broker.spec @@ -1,6 +1,6 @@ Name: dbus-broker Version: 29 -Release: 4 +Release: 5 Summary: Linux D-Bus Message Broker License: Apache License 2.0 URL: https://github.com/bus1/dbus-broker @@ -53,15 +53,22 @@ if ! getent passwd dbus > /dev/null ; then fi %preun -%systemd_preun dbus-broker.service %systemd_user_preun dbus-broker.service +# Disable and stop dbus-broker.service after pre uninstalling +if [ $1 == 0 ] && [ -x /usr/bin/systemctl ]; then + systemctl disable dbus-broker.service &>/dev/null || : + systemctl reset-failed dbus-broker.service &>/dev/null || : + systemctl stop dbus-broker.service &>/dev/null || : +fi %post -%systemd_post dbus-broker.service %systemd_user_post dbus-broker.service +# Enable after installing +if [ $1 == 1 ] && [ -x /usr/bin/systemctl ]; then + systemctl --no-reload enable dbus-broker.service &>/dev/null || : +fi %postun -%systemd_postun dbus-broker.service %systemd_user_postun dbus-broker.service %files @@ -74,6 +81,9 @@ fi %{_userunitdir}/dbus-broker.service %changelog +* Thu Dec 01 2022 licunlong - 29-5 +- Optimize installing and removing dbus-broker + * Tue Nov 22 2022 hongjinghao - 29-4 - Fix CVE-2022-31212 and CVE-31213