remove old initscript and complete systemd migration [release 1.8.8-2mamba;Fri Dec 05 2014]
This commit is contained in:
Silvan Calarco 2024-01-05 21:40:22 +01:00
parent 982287983b
commit c5c6a5e201
2 changed files with 34 additions and 27 deletions

View File

@ -0,0 +1,11 @@
diff -Nru dbus-1.8.12.orig/bus/dbus.service.in dbus-1.8.12/bus/dbus.service.in
--- dbus-1.8.12.orig/bus/dbus.service.in 2014-11-04 15:51:05.000000000 +0100
+++ dbus-1.8.12/bus/dbus.service.in 2014-12-04 12:20:18.198000000 +0100
@@ -2,6 +2,7 @@
Description=D-Bus System Message Bus
Documentation=man:dbus-daemon(1)
Requires=dbus.socket
+Before=basic.target
[Service]
ExecStart=@EXPANDED_BINDIR@/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation

View File

@ -3,7 +3,7 @@
Name: dbus
Version: 1.8.8
Release: 1mamba
Release: 2mamba
Summary: A message bus, used for sending messages between applications
Group: System/Servers
Vendor: openmamba
@ -15,6 +15,7 @@ Source1: dbus-initscript
Source2: %{name}-session-profile.sh
Patch0: %{name}-1.0.1-cve_2006_6107.patch
Patch1: dbus-1.6.8-initscript-rename.patch
Patch2: dbus-1.8.12-systemd-fix-shutdown-hangs.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
@ -25,13 +26,12 @@ BuildRequires: libX11-devel
%endif
BuildRequires: libaudit-devel
BuildRequires: libcap-ng-devel
BuildRequires: libdw-devel
BuildRequires: libexpat-devel
BuildRequires: libgcrypt-devel
BuildRequires: libgpg-error-devel
BuildRequires: liblzma-devel
BuildRequires: libpcre-devel
BuildRequires: libselinux-devel
BuildRequires: libsepol-devel
BuildRequires: systemd-devel
## AUTOBUILDREQ-END
%if "%{stage1}" != "1"
@ -111,7 +111,7 @@ This package includes the %{name} API documentation.
%prep
%setup -q
%patch0 -p1 -b .cve_2006_6107
%patch1 -p1
%patch2 -p1
%build
%configure \
@ -120,7 +120,6 @@ This package includes the %{name} API documentation.
--enable-systemd \
--disable-checks \
--disable-asserts \
--with-init-scripts=redhat \
--with-system-pid-file=%{_var}/run/messagebus.pid \
--with-system-socket=%{_var}/run/dbus/system_bus_socket \
--with-session-socket-dir=/tmp \
@ -144,9 +143,6 @@ install -d %{buildroot}%{_var}/lib/dbus
#install -m 0755 %{S:1} %{buildroot}%{_initrddir}/messagebus
install -D -m 0755 %{S:2} %{buildroot}%{_sysconfdir}/profile.d/dbus-session.sh
# rename initscript for systemd compatibility
mv %{buildroot}%{_initrddir}/messagebus %{buildroot}%{_initrddir}/dbus
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
@ -161,33 +157,30 @@ fi
:
%post
%systemd_post %{name}
if [ $1 -ge 1 ]; then
/sbin/ldconfig
/sbin/chkconfig --del messagebus 2>&1 || true
/sbin/chkconfig --add dbus
[ $1 -eq 1 ] && service dbus start
[ $1 -eq 1 ] && systemctl -q start dbus
%{_bindir}/dbus-uuidgen --ensure
fi
:
%preun
# erase
%systemd_preun %{name}
if [ $1 -eq 0 ]; then
service dbus stop 2>/dev/null
/sbin/chkconfig --del dbus
userdel messagebus || true
groupdel messagebus || true
fi
:
%triggerpostun -- dbus1
# this is required because the obsoletion of dbus1 removes the
# user and disables the service
/usr/sbin/useradd -u %{messagebus_uid} -c 'DBUS user' -d /dev/null \
-s /bin/false messagebus 2>/dev/null
/sbin/chkconfig --add dbus
service dbus start
%{_bindir}/dbus-uuidgen --ensure
%postun
%systemd_postun %{name}
:
%posttrans
# clean old sysv broken links
find /etc/rc[0-6].d/ -type l -xtype l -exec rm -f {} \;
:
%post -n lib%{name} -p /sbin/ldconfig
@ -195,7 +188,6 @@ service dbus start
%files
%defattr(-,root,root)
%{_initrddir}/dbus
%dir %{_sysconfdir}/dbus-1
%config %{_sysconfdir}/dbus-1/session.conf
%config %{_sysconfdir}/dbus-1/system.conf
@ -210,11 +202,11 @@ service dbus start
%{_bindir}/dbus-send
%{_bindir}/dbus-uuidgen
%attr(4750,root,messagebus) %{_libexecdir}/dbus-daemon-launch-helper
/lib/systemd/system/dbus.service
/lib/systemd/system/dbus.socket
/lib/systemd/system/dbus.target.wants/dbus.socket
/lib/systemd/system/multi-user.target.wants/dbus.service
/lib/systemd/system/sockets.target.wants/dbus.socket
%{_unitdir}/dbus.service
%{_unitdir}/dbus.socket
%{_unitdir}/dbus.target.wants/dbus.socket
%{_unitdir}/multi-user.target.wants/dbus.service
%{_unitdir}/sockets.target.wants/dbus.socket
%dir %{_datadir}/dbus-1/services
%dir %{_var}/run/dbus
%dir %{_var}/lib/dbus
@ -265,6 +257,10 @@ service dbus start
%{_docdir}/dbus/*
%changelog
* Fri Dec 05 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 1.8.8-2mamba
- patch systemd service file to fix shutdown hang (http://superuser.com/questions/767414/why-does-systemd-hang-during-reboot)
- remove old initscript and complete systemd migration
* Sat Sep 20 2014 Automatic Build System <autodist@mambasoft.it> 1.8.8-1mamba
- automatic version update by autodist