[Pkg-lirc-maint] Bug#362217: udev: init.d/lirc checks /dev/lirc0 before udev allocates it

Adeodato Simó dato at net.com.org.es
Sat Jun 3 10:00:48 UTC 2006

* Steve Langasek [Wed, 12 Apr 2006 15:51:08 -0700]:

> On Wed, Apr 12, 2006 at 11:00:07PM +0200, Wolfgang Rohdewald wrote:
> > if udev is used and /etc/init.d/lirc loads the lirc modules, 
> > it should wait for a moment after doing modprobe. Otherwise
> > this happens in /etc/init.d/lirc:

> > modprobe lirc_serial
> > # here we should sleep for a second, so that udev has time to
> > # allocate /dev/lirc0
> > test -c /dev/lirc0 	# does not yet exist
> > build_args() fails to use /dev/lirc0

> > simple patch is to add "sleep 1" in load_modules.

> A fixed delay isn't reliable either.

Marco, how should init scripts that load modules and use the device
afterwards behave?, is there a common policy? My best guess is the
following, but I'd like confirmation:

  modprobe foo

  if [ -x /sbin/udevsettle ]; then
      /sbin/udevsettle || echo "Warning: udevsettle timeout"

  if [ -e /dev/wanted_device ]; then
      die "wanted_device not present in /dev"


Adeodato Simó                                     dato at net.com.org.es
Debian Developer                                  adeodato at debian.org
                                   Listening to: Placebo - Special Needs

More information about the Pkg-lirc-maint mailing list