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
This commit is contained in:
parent
38242a2aff
commit
a5e985ccd5
13
0001-Add-RefuseManualStartStop.patch
Normal file
13
0001-Add-RefuseManualStartStop.patch
Normal file
@ -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
|
@ -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
|
||||
|
||||
|
40
dbus-1.spec
40
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 <<EOF
|
||||
# temporarily added by rpm update to avoid dbus service restart
|
||||
# backup saved in %{_backup}
|
||||
DISABLE_RESTART_ON_UPDATE="yes"
|
||||
EOF
|
||||
fi
|
||||
|
||||
%post
|
||||
if [ -e %{_localstatedir}/lib/dbus/machine-id -a -e %{_sysconfdir}/machine-id ]; then
|
||||
cmp -s %{_localstatedir}/lib/dbus/machine-id %{_sysconfdir}/machine-id > /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
|
||||
|
Loading…
Reference in New Issue
Block a user