gmane at colin.guthr.ie
Sun Sep 2 07:04:35 PDT 2012
'Twas brillig, and Вечный Студент at 02/09/12 14:47 did gyre and gimble:
> The aim is to use LIRC with lirc_serial module. To get it these operations must take place in a given order:
> - udev must name a serial port
> - serial port must be freed from (built in) kernel serial driver with command 'setserial /dev/ttyS0 uart none'
> - lirc_serial driver must be loaded
> - lircd service must be started
> I have tried to add 'setserial ...' command into udev rule (RUN+=), add lirc_serial module to /etc/modules-load and enable lircd service - all these under systemd - but needed sequence of operation takes place randomly only. Currently I use custom script which I start manually after booting (and, of course, it does work always):
> ~ $ cat `which mylirc.sh`
> /usr/bin/systemctl stop lircd.service
> /usr/bin/rmmod lirc_serial
> /usr/bin/setserial /dev/ttyS0 uart none
> /sbin/modprobe lirc_serial
> /usr/bin/systemctl start lircd.service
> Can anybody suggest legal systemd/udev way to get needed sequence of operations?
Can you use a templated unit for lircd? e.g. lircd at ttyS0.service,
afterall I presume you have to run a separate licrd for each serial port
If so, then your licrd at .service file would contain something like:
ExecStartPre=-/usr/bin/setserial /dev/%i uart none
Not sure it's the most graceful of solutions and if you do have multiple
remotes connected (admittedly a somewhat uncommon setup) then the rmmod
will likely fail).
Still you might be able to do what you need to do with ExecStartPre even
in a non-templated unit that will do what you need it to.
Tribalogic Limited http://www.tribalogic.net/
Mageia Contributor http://www.mageia.org/
PulseAudio Hacker http://www.pulseaudio.org/
Trac Hacker http://trac.edgewall.org/
More information about the systemd-devel