Address Bug 1552971

Hide systemctl failures so LVM2 can be installed in chroot or container.
This commit is contained in:
Marian Csontos 2018-05-24 16:23:34 +02:00
parent b5fe257e1b
commit 3637b46f91

View File

@ -194,9 +194,10 @@ make -C test install DESTDIR=$RPM_BUILD_ROOT
/sbin/ldconfig /sbin/ldconfig
%systemd_post blk-availability.service lvm2-monitor.service %systemd_post blk-availability.service lvm2-monitor.service
if [ "$1" = "1" ] ; then if [ "$1" = "1" ] ; then
# FIXME: what to do with this? We do not want to start it in a container/chroot
# enable and start lvm2-monitor.service on completely new installation only, not on upgrades # enable and start lvm2-monitor.service on completely new installation only, not on upgrades
systemctl enable lvm2-monitor.service systemctl enable lvm2-monitor.service
systemctl start lvm2-monitor.service systemctl start lvm2-monitor.service || :
fi fi
%if %{enable_lvmetad} %if %{enable_lvmetad}
%systemd_post lvm2-lvmetad.socket %systemd_post lvm2-lvmetad.socket
@ -204,7 +205,7 @@ fi
# replace direct systemctl calls with systemd rpm macro once this is provided in the macro: # replace direct systemctl calls with systemd rpm macro once this is provided in the macro:
# http://cgit.freedesktop.org/systemd/systemd/commit/?id=57ab2eabb8f92fad5239c7d4492e9c6e23ee0678 # http://cgit.freedesktop.org/systemd/systemd/commit/?id=57ab2eabb8f92fad5239c7d4492e9c6e23ee0678
systemctl enable lvm2-lvmetad.socket systemctl enable lvm2-lvmetad.socket
systemctl start lvm2-lvmetad.socket systemctl start lvm2-lvmetad.socket || :
%endif %endif
%if %{enable_lvmpolld} %if %{enable_lvmpolld}
@ -213,7 +214,7 @@ systemctl start lvm2-lvmetad.socket
# replace direct systemctl calls with systemd rpm macro once this is provided in the macro: # replace direct systemctl calls with systemd rpm macro once this is provided in the macro:
# http://cgit.freedesktop.org/systemd/systemd/commit/?id=57ab2eabb8f92fad5239c7d4492e9c6e23ee0678 # http://cgit.freedesktop.org/systemd/systemd/commit/?id=57ab2eabb8f92fad5239c7d4492e9c6e23ee0678
systemctl enable lvm2-lvmpolld.socket systemctl enable lvm2-lvmpolld.socket
systemctl start lvm2-lvmpolld.socket systemctl start lvm2-lvmpolld.socket || :
%endif %endif
%preun %preun
@ -799,7 +800,7 @@ of device-mapper devices.
# replace direct systemctl calls with systemd rpm macro once this is provided in the macro: # replace direct systemctl calls with systemd rpm macro once this is provided in the macro:
# http://cgit.freedesktop.org/systemd/systemd/commit/?id=57ab2eabb8f92fad5239c7d4492e9c6e23ee0678 # http://cgit.freedesktop.org/systemd/systemd/commit/?id=57ab2eabb8f92fad5239c7d4492e9c6e23ee0678
systemctl enable dm-event.socket systemctl enable dm-event.socket
systemctl start dm-event.socket systemctl start dm-event.socket || :
if [ -e %{_default_pid_dir}/dmeventd.pid ]; then if [ -e %{_default_pid_dir}/dmeventd.pid ]; then
%{_sbindir}/dmeventd -R || echo "Failed to restart dmeventd daemon. Please, try manual restart." %{_sbindir}/dmeventd -R || echo "Failed to restart dmeventd daemon. Please, try manual restart."
fi fi