I'm facing a problem with lirc and udev.
my udev rules:
my start up scripts (in GeeXboX) are somewhat like:
lircd --driver=3Ddefault --device=3D/dev/lirc
irpty /etc/lircrc -- mplayer
The problem is that I need to be sure lircd is running before
executing irpty for it to work, but I also need when irpty tries
to connect to lircd the device /dev/lirc should exists (created by udev)
but sometimes, udev does not manage to create the devices in time
before irpty connects and causes lircd.c:add_client() to fail.
what is the right way to start lirc modules / lircd / irpty clients ?
At start I thought about starting lircd using udev rules
but then there's a chance irpty will be executed before lircd is executed
so irpty will fail to connect.
currently we have put out a temporery solution before executing lircd
to wait up to 3 seconds while device does not exists.
while [ ! -e /dev/lirc -a $((i++)) -lt 3 ]; do sleep 1; done
but this slows down the boot time for users who dont own a remote control.
After some thought I think the "right" way to solve this timing issue
to make lircd act as redirecting daemon between clients and remote controls.
we'll have a remote control daemon,
which will connect as lirc client to lircd and will push data keys.
remote control daemons will push data into /dev/lircd
and lirc clients (irpty, etc) will read data from /dev/lircd.
this will allow me to start lircd before mplayer,
and to attach the remote control daemon to lircd using udev rules.
what do you think ?