dbus: make use of [Install] unit sections
Rather than installing symlinks during the installation manually, put in [Install] sections into the units. This has the same effect, but allows changing the installation conditions via systemd-presets, which are provided by the 'fedora-release' package. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
This commit is contained in:
parent
2fe9ed5df9
commit
896fb4a918
@ -7,3 +7,7 @@ Requires=dbus.socket
|
|||||||
ExecStart=/usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
|
ExecStart=/usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
|
||||||
ExecReload=/usr/bin/dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig
|
ExecReload=/usr/bin/dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig
|
||||||
OOMScoreAdjust=-900
|
OOMScoreAdjust=-900
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
Alias=dbus.service
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
@ -6,3 +6,6 @@ Requires=dbus.socket
|
|||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
|
ExecStart=/usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
|
||||||
ExecReload=/usr/bin/dbus-send --print-reply --session --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig
|
ExecReload=/usr/bin/dbus-send --print-reply --session --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
Alias=dbus.service
|
||||||
|
@ -3,3 +3,6 @@ Description=D-Bus System Message Bus Socket
|
|||||||
|
|
||||||
[Socket]
|
[Socket]
|
||||||
ListenStream=/run/dbus/system_bus_socket
|
ListenStream=/run/dbus/system_bus_socket
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=sockets.target
|
||||||
|
23
dbus.spec
23
dbus.spec
@ -5,6 +5,9 @@
|
|||||||
|
|
||||||
%global libselinux_version 2.0.86
|
%global libselinux_version 2.0.86
|
||||||
|
|
||||||
|
# fedora-release-30-0.2 added required presets to enable systemd-unit symlinks
|
||||||
|
%global system_release_version 30-0.2
|
||||||
|
|
||||||
%global dbus_user_uid 81
|
%global dbus_user_uid 81
|
||||||
|
|
||||||
%global dbus_common_config_opts --enable-libaudit --enable-selinux=yes --with-system-socket=/run/dbus/system_bus_socket --with-dbus-user=dbus --libexecdir=/%{_libexecdir}/dbus-1 --enable-user-session --docdir=%{_pkgdocdir} --enable-installed-tests
|
%global dbus_common_config_opts --enable-libaudit --enable-selinux=yes --with-system-socket=/run/dbus/system_bus_socket --with-dbus-user=dbus --libexecdir=/%{_libexecdir}/dbus-1 --enable-user-session --docdir=%{_pkgdocdir} --enable-installed-tests
|
||||||
@ -84,6 +87,7 @@ Summary: D-BUS message bus configuration
|
|||||||
Group: System Environment/Libraries
|
Group: System Environment/Libraries
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
Requires(pre): /usr/sbin/useradd
|
Requires(pre): /usr/sbin/useradd
|
||||||
|
Requires: system-release >= %{system_release_version}
|
||||||
|
|
||||||
%description common
|
%description common
|
||||||
The %{name}-common package provides the configuration and setup files for D-Bus
|
The %{name}-common package provides the configuration and setup files for D-Bus
|
||||||
@ -220,15 +224,6 @@ install -Dp -m644 %{SOURCE3} %{buildroot}%{_unitdir}/dbus-daemon.service
|
|||||||
install -Dp -m644 %{SOURCE4} %{buildroot}%{_userunitdir}/dbus.socket
|
install -Dp -m644 %{SOURCE4} %{buildroot}%{_userunitdir}/dbus.socket
|
||||||
install -Dp -m644 %{SOURCE5} %{buildroot}%{_userunitdir}/dbus-daemon.service
|
install -Dp -m644 %{SOURCE5} %{buildroot}%{_userunitdir}/dbus-daemon.service
|
||||||
|
|
||||||
# dbus-daemon is the default D-Bus implementation on Fedora
|
|
||||||
ln -f -s dbus-daemon.service %{buildroot}%{_unitdir}/dbus.service
|
|
||||||
ln -f -s dbus-daemon.service %{buildroot}%{_userunitdir}/dbus.service
|
|
||||||
|
|
||||||
# D-Bus is unconditionally enabled on all systems
|
|
||||||
ln -f -s ../dbus.service %{buildroot}%{_unitdir}/multi-user.target.wants/dbus.service
|
|
||||||
ln -f -s ../dbus.socket %{buildroot}%{_unitdir}/sockets.target.wants/dbus.socket
|
|
||||||
ln -f -s ../dbus.socket %{buildroot}%{_userunitdir}/sockets.target.wants/dbus.socket
|
|
||||||
|
|
||||||
# Make sure that when somebody asks for D-Bus under the name of the
|
# Make sure that when somebody asks for D-Bus under the name of the
|
||||||
# old SysV script, that he ends up with the standard dbus.service name
|
# old SysV script, that he ends up with the standard dbus.service name
|
||||||
# now.
|
# now.
|
||||||
@ -383,15 +378,10 @@ popd
|
|||||||
%exclude %{_libexecdir}/dbus-1/dbus-run-installed-tests
|
%exclude %{_libexecdir}/dbus-1/dbus-run-installed-tests
|
||||||
%{_tmpfilesdir}/dbus.conf
|
%{_tmpfilesdir}/dbus.conf
|
||||||
%{_unitdir}/dbus-daemon.service
|
%{_unitdir}/dbus-daemon.service
|
||||||
%{_unitdir}/dbus.service
|
|
||||||
%{_unitdir}/dbus.socket
|
%{_unitdir}/dbus.socket
|
||||||
%{_unitdir}/messagebus.service
|
%{_unitdir}/messagebus.service
|
||||||
%{_unitdir}/multi-user.target.wants/dbus.service
|
|
||||||
%{_unitdir}/sockets.target.wants/dbus.socket
|
|
||||||
%{_userunitdir}/dbus-daemon.service
|
%{_userunitdir}/dbus-daemon.service
|
||||||
%{_userunitdir}/dbus.service
|
|
||||||
%{_userunitdir}/dbus.socket
|
%{_userunitdir}/dbus.socket
|
||||||
%{_userunitdir}/sockets.target.wants/dbus.socket
|
|
||||||
|
|
||||||
%files tools
|
%files tools
|
||||||
%{!?_licensedir:%global license %%doc}
|
%{!?_licensedir:%global license %%doc}
|
||||||
@ -442,6 +432,11 @@ popd
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Aug 10 2018 David Herrmann <dh.herrmann@gmail.com> - 1:1.12.10-1
|
||||||
|
- Add [Install] sections to unit files, rather than creating the symlinks
|
||||||
|
manually during the installation. This will pick up the systemd-presets
|
||||||
|
global to Fedora from the 'fedora-release' package.
|
||||||
|
|
||||||
* Fri Aug 10 2018 David Herrmann <dh.herrmann@gmail.com> - 1:1.12.10-1
|
* Fri Aug 10 2018 David Herrmann <dh.herrmann@gmail.com> - 1:1.12.10-1
|
||||||
- Provide custom systemd unit files to replace the upstream units. Also rename
|
- Provide custom systemd unit files to replace the upstream units. Also rename
|
||||||
the service to 'dbus-daemon.service', but provide an alias to 'dbus.service'.
|
the service to 'dbus-daemon.service', but provide an alias to 'dbus.service'.
|
||||||
|
@ -4,3 +4,6 @@ Description=D-Bus User Message Bus Socket
|
|||||||
[Socket]
|
[Socket]
|
||||||
ListenStream=%t/bus
|
ListenStream=%t/bus
|
||||||
ExecStartPost=-/usr/bin/systemctl --user set-environment DBUS_SESSION_BUS_ADDRESS=unix:path=%t/bus
|
ExecStartPost=-/usr/bin/systemctl --user set-environment DBUS_SESSION_BUS_ADDRESS=unix:path=%t/bus
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=sockets.target
|
||||||
|
Loading…
Reference in New Issue
Block a user