Код:
#!/sbin/runscript
# Copyright 2003 Martin Hierling <mad@cc.fh-lippe.de>
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/files/irexec-initd,v 1.2 2006/12/02 12:04:13 zzam Exp $
: ${IREXEC_USER:=root}
depend() {
need lircd
}
start() {
if [[ ${IREXEC_USER} == "root" && ${IREXEC_DISABLE_ROOT_WARNING} != yes ]]; then
ewarn "Warning: Running irexec as root can open security holes"
fi
ebegin "Starting irexec"
einfo "${IREXEC_USER}"
einfo "$IREXEC_OPTS"
start-stop-daemon --start --chuid ${IREXEC_USER} --user ${IREXEC_USER} --chdir / \
--exec /usr/bin/irexec -- --daemon ${IREXEC_OPTS}
eend $? "Failed to start irexec."
}
stop() {
ebegin "Stopping irexec"
start-stop-daemon --stop --exec /usr/bin/irexec --user ${IREXEC_USER}
eend $? "Failed to stop irexec."
}
Далее проводятся следующие действия
Код: Выделить всё
localhost ~ # /etc/init.d/irexec start
* Caching service dependencies ... [ ok ]
* Service irexec starting
* Starting irexec ...
* irexec
* /etc/lircrc [ ok ]
* Service irexec started
localhost ~ # ps aux | grep irexec
irexec 16160 0.0 0.0 1696 144 ? Ss 13:13 0:00 /usr/bin/irexec --daemon /etc/lircrc
root 16337 0.0 0.1 3072 844 pts/2 R+ 13:13 0:00 grep --colour=auto irexecПульт НЕ работает
останавливаем
Код: Выделить всё
localhost ~ # /etc/init.d/irexec stop
* Service irexec stopping
* Stopping irexec ... [ ok ]
* Service irexec stoppedПробуем напрямую
Код: Выделить всё
localhost ~ # start-stop-daemon --start --chuid irexec --user irexec --chdir / --exec /usr/bin/irexec -- --daemon /etc/lircrc
localhost ~ # ps aux | grep irexec
irexec 16598 0.0 0.0 1700 148 ? Ss 13:14 0:00 /usr/bin/irexec --daemon /etc/lircrc
root 16636 0.0 0.1 3072 848 pts/2 R+ 13:14 0:00 grep --colour=auto irexecПульт работает
останавливаем
Код: Выделить всё
localhost ~ # start-stop-daemon --stop --exec /usr/bin/irexec --user irexecУ кого какие мысли?
/var/log/lircd/current
Код: Выделить всё
Jun 6 13:13:07 [lircd-0.8.1] accepted new client on /dev/lircd
Jun 6 13:14:03 [lircd-0.8.1] removed client
Jun 6 13:14:11 [lircd-0.8.1] accepted new client on /dev/lircd
Jun 6 13:16:45 [lircd-0.8.1] removed client