Решено: Странное поведение /etc/init.d/irexec (однако шаман нужен)

Sabayon, Calculate, Funtoo, Exherbo

Модератор: /dev/random

Mellon
Сообщения: 655
Статус: Powered by Gentoo
ОС: Gentoo

Решено: Странное поведение /etc/init.d/irexec

Сообщение Mellon »

Имеется /etc/init.d/irexec

Код:

#!/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
Некоммерческий файлообмен не может сравниваться с кражей, так как кража лишает кого-то возможности использовать украденный объект. ©
--------------------
Переворачиватель пингвинов
Спасибо сказали:
Mellon
Сообщения: 655
Статус: Powered by Gentoo
ОС: Gentoo

Re: Решено: Странное поведение /etc/init.d/irexec

Сообщение Mellon »

однако моя разгадал зогадку

дело в том, что инит-скрипты выполняются в сильно ограниченном окружении.
В результате их потомки (в частности, проги запускаемые irexec'ом) не могут видеть часть своих настроек передаваемых переменными.

В итоге, в данном случае, проблему решил явно прописав эти переменные в командах запуска
Некоммерческий файлообмен не может сравниваться с кражей, так как кража лишает кого-то возможности использовать украденный объект. ©
--------------------
Переворачиватель пингвинов
Спасибо сказали: