Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dracut): rework timeout for devices added via --mount and --add-device (bsc#1231792) #386

Open
wants to merge 2 commits into
base: SUSE/059
Choose a base branch
from

Conversation

aafeijoo-suse
Copy link
Collaborator

Currently, dracut adds a systemd dropin that sets an infinite timeout only for the underlying persistent devices of each host device that must be active in the initrd. E.g.:

localhost:~ # dracut -f --stdlog 3 --install "/mnt" --mount "/dev/sda1 /mnt btrfs rw,relatime"
localhost:~ # lsinitrd | grep timeout.conf
-rw-r--r--   2 root     root            0 Oct 28 14:21 etc/systemd/system/dev-disk-by\x2duuid-0d1b24c2\x2df112\x2d48ef\x2d8442\x2d1001cffc92f0.device.d/timeout.conf
localhost:~ # ls -l /dev/disk/by-uuid/0d1b24c2-f112-48ef-8442-1001cffc92f0
lrwxrwxrwx 1 root root 10 Oct 28 11:43 /dev/disk/by-uuid/0d1b24c2-f112-48ef-8442-1001cffc92f0 -> ../../sda1

It can be verified in the emergency shell:

sh-5.2# systemctl show --property JobRunningTimeoutUSec /dev/disk/by-uuid/0d1b24c2-f112-48ef-8442-1001cffc92f0
JobRunningTimeoutUSec=infinity
sh-5.2# systemctl show --property JobRunningTimeoutUSec /dev/sda1
JobRunningTimeoutUSec=1min 30s

This can cause a problem if a user application expects to mount /dev/sda1 in the initrd (that's why it was explicitly added --mount "/dev/sda1 ..."), but for some reason the link is not created within 1min 30s.

(cherry picked from commit dracut-ng/dracut-ng@c79fc8f)


I'm not 100% convinced about this patch yet, but since it was accepted upstream we should evaluate whether it deserves to be backported.

…evice

Currently, dracut adds a systemd dropin that sets an infinite timeout _only_ for
the underlying persistent devices of each host device that must be active in the
initrd. E.g.:

```
localhost:~ # dracut -f --stdlog 3 --install "/mnt" --mount "/dev/sda1 /mnt btrfs rw,relatime"
localhost:~ # lsinitrd | grep timeout.conf
-rw-r--r--   2 root     root            0 Oct 28 14:21 etc/systemd/system/dev-disk-by\x2duuid-0d1b24c2\x2df112\x2d48ef\x2d8442\x2d1001cffc92f0.device.d/timeout.conf
localhost:~ # ls -l /dev/disk/by-uuid/0d1b24c2-f112-48ef-8442-1001cffc92f0
lrwxrwxrwx 1 root root 10 Oct 28 11:43 /dev/disk/by-uuid/0d1b24c2-f112-48ef-8442-1001cffc92f0 -> ../../sda1
```

It can be verified in the emergency shell:

```
sh-5.2# systemctl show --property JobRunningTimeoutUSec /dev/disk/by-uuid/0d1b24c2-f112-48ef-8442-1001cffc92f0
JobRunningTimeoutUSec=infinity
sh-5.2# systemctl show --property JobRunningTimeoutUSec /dev/sda1
JobRunningTimeoutUSec=1min 30s
```

This can cause a problem if a user application expects to mount /dev/sda1 in the
initrd (that's why it was explicitly added `--mount "/dev/sda1 ..."`), but for
some reason the link is not created within 1min 30s.

(cherry picked from commit dracut-ng/dracut-ng@c79fc8f)

bsc#1231792
Copy link
Collaborator

@tblume tblume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree to the doubts about the patch.
We might hide other issues (e.g. device link creation) therewith.
On the other hand it is a good fallback to make the system boot.
Would it be feasible to add a warning if the persistent device link cannot be used and we switch to the fallback instead?

@aafeijoo-suse
Copy link
Collaborator Author

I agree to the doubts about the patch. We might hide other issues (e.g. device link creation) therewith. On the other hand it is a good fallback to make the system boot.

The idea is that devices added via --mount and --add-device should be additional user devices. The underlying root device and the symlink pointed by root= on the kernel command line, and other important devices are already added automatically by dracut.

Would it be feasible to add a warning if the persistent device link cannot be used and we switch to the fallback instead?

Do you mean adding a warning at boot? I don't think so... at that point systemd is in charge. The unique effect of this patch is extending the default timeout from 1m 30s to infinity for the symlink added using these user options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants