Bug#728486: Current patch for resolving lvm/systemd compatibility
On Sat, Jan 18, 2014 at 01:20:41PM +0100, Bastian Blank wrote:
> Untested patch:
>
> - Static services with the correct name.
Well, the original names from the upstream patch weren't really incorrect.
You just have to make sure that the lvm2 sysv init script is correcly
"shadowed" by the native service file. Using Alias=lvm2 would have
worked as well.
That said, if you prefer those names, that is ok.
> - lvm2.service is statically hooked to local-fs.target, as all local
> mounts.
lvm2.service is not a local mount, so that is not really a justification for
enabling the service statically. That said, if you want to ship the
symlinks in the package and not allow systemctl enable|disable (via
[Install] WantedBy=), this is something I'd be personally fine with.
> \ No newline at end of property
> Index: debian/tree/lvm2/lib/systemd/system/lvm2-early.service
> ===================================================================
> --- debian/tree/lvm2/lib/systemd/system/lvm2-early.service (revision 0)
> +++ debian/tree/lvm2/lib/systemd/system/lvm2-early.service (working copy)
> @@ -0,0 +1,11 @@
> +[Unit]
> +Description=Activation of LVM2 logical volumes
> +Documentation=man:lvm(8) man:vgchange(8)
> +DefaultDependencies=no
> +After=systemd-udev-settle.service
> +Before=cryptsetup.target local-fs.target shutdown.target
> +
> +[Service]
> +ExecStartPre=/bin/udevadm settle
Please don't run udevadm directly. This is a udev command.
Instead please use
[Unit]
...
Wants=systemd-udev-settle.service
After=systemd-udev-settle.service ...
(as the original .service file does).
Wants= will make sure the systemd-udev-settle.service is started
dynamically and After= ensures the correct ordering.
> +ExecStart=/sbin/lvm vgchange -aay --sysinit
> +Type=oneshot
> Index: debian/tree/lvm2/lib/systemd/system/lvm2.service
> ===================================================================
> --- debian/tree/lvm2/lib/systemd/system/lvm2.service (revision 0)
> +++ debian/tree/lvm2/lib/systemd/system/lvm2.service (working copy)
> @@ -0,0 +1,11 @@
> +[Unit]
> +Description=Activation of LVM2 logical volumes
> +Documentation=man:lvm(8) man:vgchange(8)
> +DefaultDependencies=no
> +After=lvm2-early.service cryptsetup.target
> +Before=local-fs.target shutdown.target
> +
> +[Service]
> +ExecStartPre=/bin/udevadm settle
Please remove this ExecStartPre (see above)
Reply to: