Skip to content

eudev: rescan devices on restart - #62626

Open
eholzbach wants to merge 1 commit into
void-linux:masterfrom
eholzbach:eudev
Open

eholzbach wants to merge 1 commit into
void-linux:masterfrom
eholzbach:eudev

Conversation

@eholzbach

@eholzbach eholzbach commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

On restart, spawn a sub-shell that waits for the supervised instance of udev socket to come up, then rescan devices. This corrects permissions of devices that appear between sessions. Fixes void-linux/void-runit#135

@Duncaen

Duncaen commented Sep 20, 2026

Copy link
Copy Markdown
Member

I think makes sense to trigger and settle on every restart. Missed events are not just a first boot issues theoretically.

@eholzbach eholzbach changed the title eudev: rescan devices on first boot eudev: rescan devices on restart Sep 20, 2026
@eholzbach
eholzbach marked this pull request as ready for review September 20, 2026 15:58
@eholzbach
eholzbach force-pushed the eudev branch 2 times, most recently from 470c015 to 5f2f350 Compare September 21, 2026 23:22
Comment thread srcpkgs/eudev/files/udevd/run Outdated
(
i=0
while [ ! -S /run/udev/control ] && [ "$i" -lt 50 ]; do
sleep 0.1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

using a non-integer time value for sleep is not posix, this may cause issues for some users

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fractions are available in coreutils and busybox. I didn't consider Void users running alternative userlands. Will do some digging.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I couldn't come up with a better answer than accept waiting for a full second. Updated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

then you'll want to remove the loop

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Wouldn't that introduce a race condition where the sub-shell could run and exit before the socket comes up?

Udev is initially ran unsupervised then restarted by runit. Events that
happen during restart may leave devices with incorrect permissions. This
waits for the socket to become available then triggers a rescan.

void-linux/void-runit#135
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

elogind service starts after sound device initialization, causing permission failures

3 participants