I'm debugging lirc on a Pi 3b running Stretch with 4.19 kernel.
In my previous question, I found a way to cause lircd to function, but it requires invoking the daemon with passed parameters.
I need to start lircd like this:
sudo lircd --device /dev/lirc0
Now I want to cause the Pi to boot with lirc in a usable state, using those required parameters in init.d.
The "start-stop-daemon" section of the file "lircd" in /etc/init.d looks like this:
start-stop-daemon --start --quiet --oknodo \ --exec /usr/sbin/lircd -- < /dev/null
When the Pi boots, lircd is already running, so to allow irsend to function I have to issue these commands to kill and restart with the required parameters:
sudo pkill -SIGTERM lircd sudo lircd --device /dev/lirc0
The Man page for start-stop-daemon --start says:
"Any arguments given after -- on the command line are passed unmodified to the program being started."
I edited the "start-stop-daemon" line of the "start" case section in the file "lircd" in /etc/init.d to this:
start-stop-daemon --start --quiet --oknodo \ --exec /usr/sbin/lircd -- --device /dev/lirc0 < /dev/null
Based on the Man page for start-stop-daemon, I'm interpreting this command in its unmodified state as passing "< /dev/null" to lircd when it is run. That is the string that is after "--".
My expectation is that after my edit, the string "--device /dev/lirc0 < /dev/null" will be passed as parameters to /usr/sbin/lircd when it is run.
However, it does not work. irsend does not function at startup, until the kill and re-run commands are given. I'm assuming the parameters are not passed to lircd, but I'm not sure why.
I am not sure why the original parameters after "--" redirect /dev/null to stdin. Why is that needed? Maybe that is sending my added parameters to /dev/null too? What would be the proper syntax to pass the required parameters?