[systemd-devel] Service is started multiple times during initrd
Andrei Borzenkov
arvidjaar at gmail.com
Wed Oct 5 04:39:03 UTC 2022
On 04.10.2022 22:14, cd wrote:
...
> add_symlink "/usr/lib/systemd/system/initrd-root-fs.target.wants/lvm-autosnap-initrd.service" "/usr/lib/systemd/system/lvm-autosnap-initrd.service"
>
...
>
> Oct 04 11:49:20 archlinux systemd[1]: Reached target Initrd Default Target.
> Oct 04 11:49:20 archlinux systemd[1]: Starting Cleaning Up and Shutting Down Daemons...
> Oct 04 11:49:20 archlinux systemd[1]: Stopped target Initrd Default Target.
> Oct 04 11:49:20 archlinux systemd[1]: Stopped target Basic System.
> Oct 04 11:49:20 archlinux systemd[1]: Stopped target Initrd Root Device.
> Oct 04 11:49:20 archlinux systemd[1]: Stopped target Path Units.
> Oct 04 11:49:20 archlinux systemd[1]: Stopped target Slice Units.
> Oct 04 11:49:20 archlinux systemd[1]: Stopped target Socket Units.
> Oct 04 11:49:20 archlinux systemd[1]: Stopped target System Initialization.
> Oct 04 11:49:20 archlinux systemd[1]: Stopped target Local File Systems.
> Oct 04 11:49:20 archlinux systemd[1]: Stopped target Swaps.
> Oct 04 11:49:20 archlinux systemd[1]: Stopped target Timer Units.
> Oct 04 11:49:20 archlinux systemd[1]: Starting "Run the core lvm-autosnap logic to take manage snapshots during boot"...
>
initrd-switch-root.target Wants initrd-root-fs.target
...
>
> Is there a way to prevent this second instantiation of the service? (while preserving the oneshot behavior to prevent sysroot.mount from reaching until the service exits)
>
Add RemainAfterExit=true.
More information about the systemd-devel
mailing list