Hey people,
In the tutorial, lirc & lcd are started using cron, which I guess is not the best way to go.
I tried to make a daemon, based on the standard lirc debian daemon, but I just managed to have lirc working, not the LCD, as I have basically no knowledge.
I had to copy the lirc executable since it wouldn't start otherwise, so I have lirc running the /dev/lirc0 and lirc1 running the /dev/lirc1.
I added the chmod & LCDd lines directly below the lirc lines but I guess we should use start-stop-daemon (as the lcd doesn't work), but I don't really know how.
Ok, up to you know to make it work now
Here is what I use.
Code:
#! /bin/sh
#
# This is an init script for Debian 2.1 Slink distribution.
# Copy it to /etc/init.d/lirc and type
# > update-rc.d lirc defaults 20
#
test -f /usr/local/sbin/lircd || exit 0
test -f /usr/local/sbin/lircmd || exit 0
case "$1" in
start)
echo -n "Starting lirc daemon: lircd"
start-stop-daemon --start --quiet --exec /usr/local/sbin/lircd -- --driver=default --device=/dev/lirc0 --pidfile=/var/run/lirc0.pid --listen=8765
start-stop-daemon --start --quiet --exec /usr/local/sbin/lircd1 -- --driver=default --device=/dev/lirc1 --pidfile=/var/run/lirc1.pid --output=/dev/lircd --connect=localhost:8765
chmod 777 /dev/lcd0
LCDd
echo "."
;;
stop)
echo -n "Stopping lirc daemon: lircd"
start-stop-daemon --stop --quiet --exec /usr/local/sbin/lircd
start-stop-daemon --stop --quiet --exec /usr/local/sbin/lircd1
echo "."
;;
reload|force-reload)
start-stop-daemon --stop --quiet --signal 1 --exec /usr/local/sbin/lircd
;;
restart)
echo -n "Stopping lirc daemon: lircd"
start-stop-daemon --stop --quiet --exec /usr/local/sbin/lircd
sleep 1
echo -n "Starting lirc daemon: lircd"
start-stop-daemon --start --quiet --exec /usr/local/sbin/lircd -- --driver=default --device=/dev/lirc0 --pidfile=/var/run/lirc0.pid --listen=8765
start-stop-daemon --start --quiet --exec /usr/local/sbin/lircd1 -- --driver=default --device=/dev/lirc1 --pidfile=/var/run/lirc1.pid --output=/dev/lircd --connect=localhost:8765
echo "."
;;
*)
echo "Usage: /etc/init.d/lircd {start|stop|reload|restart|force-reload}"
exit 1
esac
exit 0