1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

systemd: add missing Before=shutdown.target to LVM2 services to fix shutdown ordering

We already used Conflicts=shutdown target to stop LVM2 services on shutdown.
But we still missed the ordering - the shutdown.target should be reached
only after all the services are really stopped.

Reported here: https://github.com/lvmteam/lvm2/issues/17
This commit is contained in:
Peter Rajnoha 2019-04-09 12:10:17 +02:00
parent 344a9e9afd
commit 0cab341e1d
7 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,6 @@
Version 2.03.02 -
===================================
Add missing Before=shutdown.target to LVM2 services to fix shutdown ordering.
Skip autoactivation for a PV when PV size does not match device size.
Remove first-pvscan-initialization which should no longer be needed.
Add remote refresh through lvmlockd/dlm for shared LVs after lvextend.

View File

@ -1,5 +1,6 @@
[Unit]
Description=Availability of block devices
Before=shutdown.target
After=lvm2-activation.service iscsi-shutdown.service iscsi.service iscsid.service fcoe.service rbdmap.service
DefaultDependencies=no
Conflicts=shutdown.target

View File

@ -139,6 +139,8 @@ static int generate_unit(struct generator *gen, int unit)
"Documentation=man:lvm2-activation-generator(8)\n"
"SourcePath=/etc/lvm/lvm.conf\n" "DefaultDependencies=no\n", f);
fputs("Conflicts=shutdown.target\n", f);
if (unit == UNIT_NET) {
fprintf(f, "After=%s iscsi.service fcoe.service rbdmap.service\n"
"Before=remote-fs-pre.target shutdown.target\n\n"

View File

@ -3,7 +3,7 @@ Description=Clustered LVM mirror log daemon
Documentation=man:cmirrord(8)
Requires=corosync.service
After=corosync.service
Before=remote-fs-pre.target
Before=remote-fs-pre.target shutdown.target
DefaultDependencies=no
Conflicts=shutdown.target

View File

@ -2,6 +2,7 @@
Description=LVM2 poll daemon
Documentation=man:lvmpolld(8)
Requires=lvm2-lvmpolld.socket
Before=shutdown.target
After=lvm2-lvmpolld.socket
DefaultDependencies=no
Conflicts=shutdown.target

View File

@ -1,8 +1,6 @@
[Unit]
Description=LVM2 poll daemon socket
Documentation=man:lvmpolld(8)
DefaultDependencies=no
Conflicts=shutdown.target
[Socket]
ListenStream=@DEFAULT_RUN_DIR@/lvmpolld.socket

View File

@ -3,7 +3,7 @@ Description=Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progres
Documentation=man:dmeventd(8) man:lvcreate(8) man:lvchange(8) man:vgchange(8)
Requires=dm-event.socket
After=dm-event.socket dm-event.service lvm2-activation.service
Before=local-fs-pre.target
Before=local-fs-pre.target shutdown.target
DefaultDependencies=no
Conflicts=shutdown.target