From a5e985ccd56150738ee1d8e936005b747c467e739bfd5129135158b356ed5fcb Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Mon, 30 Jan 2017 00:18:46 +0000 Subject: [PATCH] Accepting request 452341 from home:simotek:branches:Base:System - Don't restart dbus on upgrade - Includes temporary work around for last version boo#1020301 - Add 0001-Add-RefuseManualStartStop.patch don't allow users to Manually start or stop dbus. OBS-URL: https://build.opensuse.org/request/show/452341 OBS-URL: https://build.opensuse.org/package/show/Base:System/dbus-1?expand=0&rev=242 --- 0001-Add-RefuseManualStartStop.patch | 13 +++++++++ dbus-1.changes | 8 ++++++ dbus-1.spec | 40 ++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 0001-Add-RefuseManualStartStop.patch diff --git a/0001-Add-RefuseManualStartStop.patch b/0001-Add-RefuseManualStartStop.patch new file mode 100644 index 0000000..6b2328a --- /dev/null +++ b/0001-Add-RefuseManualStartStop.patch @@ -0,0 +1,13 @@ +Index: dbus-1.10.12/bus/dbus.service.in +=================================================================== +--- dbus-1.10.12.orig/bus/dbus.service.in ++++ dbus-1.10.12/bus/dbus.service.in +@@ -2,6 +2,8 @@ + Description=D-Bus System Message Bus + Documentation=man:dbus-daemon(1) + Requires=dbus.socket ++RefuseManualStart=true ++RefuseManualStop=true + + [Service] + ExecStart=@EXPANDED_BINDIR@/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation diff --git a/dbus-1.changes b/dbus-1.changes index 013d7a7..a680ef0 100644 --- a/dbus-1.changes +++ b/dbus-1.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Jan 25 00:49:03 UTC 2017 - sflees@suse.de + +- Don't restart dbus on upgrade - Includes temporary work around + for last version boo#1020301 +- Add 0001-Add-RefuseManualStartStop.patch don't allow users to Manually + start or stop dbus. + ------------------------------------------------------------------- Mon Jan 9 15:20:37 UTC 2017 - marius.kittler@suse.com diff --git a/dbus-1.spec b/dbus-1.spec index 64fda06..0736707 100644 --- a/dbus-1.spec +++ b/dbus-1.spec @@ -19,6 +19,8 @@ %define with_systemd 1 %define _name dbus %define _libname libdbus-1-3 +# Temporary code to disable service restart on update sflees@suse.de boo#1020301 +%global _backup /etc/sysconfig/services.rpmbak.%{name}-%{version}-%{release} %if 0%{?suse_version} <= 1320 %define _userunitdir %{_prefix}/lib/systemd/user %endif @@ -38,6 +40,8 @@ Patch0: dbus-log-deny.patch # PATCH-FIX-OPENSUSE coolo@suse.de -- force a feature configure won't accept without x11 in buildrequires Patch1: dbus-do-autolaunch.patch Patch2: 0001-Drop-Install-sections-from-user-services.patch +# Patch-Feature-opensuse sflees@suse.de, users shouldn't be allowed to start / stop the dbus service. +Patch3: 0001-Add-RefuseManualStartStop.patch BuildRequires: audit-devel BuildRequires: doxygen BuildRequires: libcap-ng-devel @@ -113,6 +117,7 @@ bus daemon). %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build echo 'HTML_TIMESTAMP=NO' >> Doxyfile.in @@ -227,6 +232,31 @@ getent passwd messagebus >/dev/null 2>/dev/null || \ %endif %service_add_pre dbus.service dbus.socket +# Lines below are temporary code to disable service restart on update sflees@suse.de boo#1020301 +# These are potentially not needed on non tumbleweed systems where updates while running a desktop are not supported. +# This seems likely to only effect the last version of tumbleweed where the service files were added and can probably be +# removed reletavly soon. + +# Get the current version +CURRENT_VER=$(dbus-daemon --version | sed 's/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/' | head -1) + +# If the current version is or less then 1.10.2 where this change was added then migration needs to be run +# The following line will return 1.10.2 if its newer then the current version +TEST_VER=$(printf "1.10.2\n$CURRENT_VER" | sort -Vr | head -1) + +if [[ "$FIRST_ARG" -gt 1 && $TEST_VER == "1.10.12" ]]; then + if [[ -f /etc/sysconfig/services ]]; then + cp -a /etc/sysconfig/services %{_backup} + else + touch %{_backup} + fi + cat >>/etc/sysconfig/services < /dev/null @@ -254,8 +284,18 @@ fi %service_del_preun dbus.service dbus.socket %postun +# immediately restarting the dbus service causes issues, As such wait for the next reboot to restart +export DISABLE_RESTART_ON_UPDATE=yes %service_del_postun dbus.service dbus.socket +%posttrans +# See comments in pre +if [[ -s %{_backup} ]]; then + mv -f %{_backup} /etc/sysconfig/services +elif [[ -e %{_backup} ]]; then + rm -f /etc/sysconfig/services +fi + %files %defattr(-, root, root) %dir %{_localstatedir}/lib/dbus