Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 523600 - sys-fs/udev-init-scripts - /etc/init.d/udev should not call `udevadm settle'
Summary: sys-fs/udev-init-scripts - /etc/init.d/udev should not call `udevadm settle'
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: udev maintainers
URL:
Whiteboard:
Keywords:
Depends on: 559540
Blocks:
  Show dependency tree
 
Reported: 2014-09-24 10:13 UTC by Roy Marples
Modified: 2015-09-03 17:17 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
0001-remove-call-to-udevadm-settle.patch (0001-remove-call-to-udevadm-settle.patch,1.03 KB, patch)
2014-11-03 18:05 UTC, William Hubbs
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roy Marples 2014-09-24 10:13:31 UTC
udev init script should not explicitly call udev-settle

Instead, the settle part should be split out into a new script called udev-settle which provides dev-settle. Other init scripts that need this (such as net.lo, lvm, raid, etc) can depend on it.

With dhcpcd having a udev plugin and no net.lo, lvm, raid, etc, there is no need to run udev-settle which makes the system boot a lot lot faster.
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2014-09-26 09:27:43 UTC
You are propably right. However, I don't trust our maintainers to know when udev-settle should be added to init script depends.
Some blog post, information page, something that would cover the cases when they need to do that, like roadmap, should be created before we just rip the udev settle out from the udev init script. ML post, wiki page, whatever, to inform maintainers/packagers/users.
Comment 2 Roy Marples 2014-10-14 09:51:42 UTC
Is there a reason why these maintainers cannot be added to this bug to co-ordinate or are you just going to let this rot?
Comment 3 William Hubbs gentoo-dev 2014-11-03 18:05:32 UTC
Created attachment 388458 [details, diff]
0001-remove-call-to-udevadm-settle.patch

This patch removes the call to udevadm settle completely.
Before I write another script that provides this, I would like to have
some folks test without the call and let me know if things break.

Thanks,

William
Comment 4 William Hubbs gentoo-dev 2014-11-03 19:14:55 UTC
Looking further at how upstream does this, there are separate services
to coldplug, and to handle settling, so I am looking into mirroring
that.
Comment 5 Roy Marples 2014-11-03 19:41:37 UTC
(In reply to William Hubbs from comment #3)
> Created attachment 388458 [details, diff] [details, diff]
> 0001-remove-call-to-udevadm-settle.patch
> 
> This patch removes the call to udevadm settle completely.
> Before I write another script that provides this, I would like to have
> some folks test without the call and let me know if things break.

I've been running the same patch for over a month without issue.
Comment 6 Mike Gilbert gentoo-dev 2014-11-03 20:17:47 UTC
(In reply to William Hubbs from comment #4)
> Looking further at how upstream does this, there are separate services
> to coldplug, and to handle settling, so I am looking into mirroring
> that.

It looks like systemd does not run udevadm settle by default.

There is a unit called systemd-udev-settle.service, but nothing activates it in a default configuration. It also contains the following comment:

# This service can dynamically be pulled-in by legacy services which
# cannot reliably cope with dynamic device configurations, and wrongfully
# expect a populated /dev during bootup.
Comment 7 William Hubbs gentoo-dev 2014-11-26 12:36:40 UTC
This is fixed in commit ebb3f35.
It will be part of udev-init-scripts 28.
Comment 8 Richard Yao (RETIRED) gentoo-dev 2015-09-02 21:08:19 UTC
(In reply to Roy Marples from comment #0)
> udev init script should not explicitly call udev-settle
> 
> Instead, the settle part should be split out into a new script called
> udev-settle which provides dev-settle. Other init scripts that need this
> (such as net.lo, lvm, raid, etc) can depend on it.
> 
> With dhcpcd having a udev plugin and no net.lo, lvm, raid, etc, there is no
> need to run udev-settle which makes the system boot a lot lot faster.

If udevadm settle is slow, we should profile it to understand why.

That said, I am okay with this idea, although not in the way commit ebb3f35 did it. Now we have three scripts for udevd, udevadm trigger and udevadm settle respectively. udevadm settle is not run by default and there is plenty of breakage.

(In reply to William Hubbs from comment #7)
> This is fixed in commit ebb3f35.
> It will be part of udev-init-scripts 28.

This broke alsasound, localmount (when /dev/disk is used), etcetera. It is also going to break ZFSOnLinux 0.6.5 when it is released because it is being fixed to depend on udev.
Comment 9 Mike Gilbert gentoo-dev 2015-09-02 22:37:15 UTC
> If udevadm settle is slow, we should profile it to understand why.

It's slow because it takes the kernel a while to enumerate all of the hardware on a given system. Many system services can be started before this, but udev-settle prevents that.
Comment 10 Richard Yao (RETIRED) gentoo-dev 2015-09-03 00:08:34 UTC
(In reply to Mike Gilbert from comment #9)
> > If udevadm settle is slow, we should profile it to understand why.
> 
> It's slow because it takes the kernel a while to enumerate all of the
> hardware on a given system. Many system services can be started before this,
> but udev-settle prevents that.

Enumeration on my systems is fast. I wonder what the difference between the two are. My systems have kernels built by genkernel HEAD.
Comment 11 Mike Gilbert gentoo-dev 2015-09-03 02:36:06 UTC
(In reply to Richard Yao from comment #10)

Sorry, I mean initialization. For example, on one of my systems, the network interfaces are not ready for several seconds after udevd starts.
Comment 12 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-09-03 05:33:12 UTC
Richard, hdd maybe? I recall udev being terribly slow at detecting partition tables on non-SSD.
Comment 13 William Hubbs gentoo-dev 2015-09-03 14:39:08 UTC
(In reply to Richard Yao from comment #8)
> (In reply to Roy Marples from comment #0)
> > udev init script should not explicitly call udev-settle
> > 
> > Instead, the settle part should be split out into a new script called
> > udev-settle which provides dev-settle. Other init scripts that need this
> > (such as net.lo, lvm, raid, etc) can depend on it.
> > 
> > With dhcpcd having a udev plugin and no net.lo, lvm, raid, etc, there is no
> > need to run udev-settle which makes the system boot a lot lot faster.
> 
> If udevadm settle is slow, we should profile it to understand why.
> 
> That said, I am okay with this idea, although not in the way commit ebb3f35
> did it. Now we have three scripts for udevd, udevadm trigger and udevadm
> settle respectively. udevadm settle is not run by default and there is
> plenty of breakage.
> 
> (In reply to William Hubbs from comment #7)
> > This is fixed in commit ebb3f35.
> > It will be part of udev-init-scripts 28.
> 
> This broke alsasound, localmount (when /dev/disk is used), etcetera. It is
> also going to break ZFSOnLinux 0.6.5 when it is released because it is being
> fixed to depend on udev.


From what I've read about localmount, we are supposed to be using labels in the filesystems nowadays instead of using full paths in /dev.

The following is from the default fstab:

# NOTE: You can use full paths to devices like /dev/sda3, but nowadays it is
#       recommended to set labels in the filesystem and mount via that.  All
#       modern Linux filesystems should support this functionality.  If your
#       boot partition is /dev/sda1 and is ext4, you can set the label of it
#       to "boot" by running:
#         # e2label /dev/sda1 boot
#       Then the LABEL example below will work for you.
LABEL=boot      /boot       ext4        noauto,noatime  1 2
LABEL=root      /       ext4        noatime     0 1
LABEL=swap      none        swap        sw      0 0

Does this solve the localmount issue? I'm as guilty as anyone; I haven't switched to this yet myself.