* [Comm] start_daemon и stop_daemon
@ 2006-06-14 12:50 Alexey Sidorov
2006-06-14 22:27 ` Dmitry V. Levin
0 siblings, 1 reply; 11+ messages in thread
From: Alexey Sidorov @ 2006-06-14 12:50 UTC (permalink / raw)
To: [Comm]
есть инит-скрипт "обслуживающий" pyicq-t
JIT_CONF=/etc/jabberd2/pyicq.xml
LOCKFILE=/var/lock/subsys/jabberd2-pyicq
PIDFILE=/var/lib/jabberd2/pid/pyicq.pid
JIT_USER=jabberd2
JIT_EXEC=/usr/libexec/pyicq-t/PyICQt.py
в start прописано:
start_daemon \
--lockfile "$LOCKFILE" \
--pidfile "$PIDFILE" \
--user "$JIT_USER" \
-- "$JIT_EXEC" -b -c "$JIT_CONF"
RETVAL=$?
в stop:
stop_daemon \
--lockfile "$LOCKFILE" \
--pidfile "$PIDFILE" \
--expect-user "$JIT_USER" \
-- "$JIT_EXEC"
RETVAL=$?
и в status:
status \
--pidfile "$PIDFILE" \
--expect-user "$JIT_USER" \
-- "$JIT_EXEC"
RETVAL=$?
стартует нормально, а вот стоп - не работает. и статус тоже говорит что процесс "стоппед" (PyICQt.py is stopped)
мне кажется это из-за того, что при старте PyICQt.py стартует (и впоследствии висит в процессах) python, и он уже в свою очередь запускает pyicqt'шный main
Что нужно прописать в stop_daemon и status что-б они работали?
--
С уважением, Алексей Сидоров
mailto:alex@reutman.ru
JIT:alexsid@jabber.ru
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Comm] start_daemon и stop_daemon
2006-06-14 12:50 [Comm] start_daemon и stop_daemon Alexey Sidorov
@ 2006-06-14 22:27 ` Dmitry V. Levin
2006-06-15 4:22 ` Alexey Sidorov
0 siblings, 1 reply; 11+ messages in thread
From: Dmitry V. Levin @ 2006-06-14 22:27 UTC (permalink / raw)
To: ALT Linux Community
[-- Attachment #1: Type: text/plain, Size: 1608 bytes --]
On Wed, Jun 14, 2006 at 04:50:44PM +0400, Alexey Sidorov wrote:
> есть инит-скрипт "обслуживающий" pyicq-t
>
> JIT_CONF=/etc/jabberd2/pyicq.xml
> LOCKFILE=/var/lock/subsys/jabberd2-pyicq
> PIDFILE=/var/lib/jabberd2/pid/pyicq.pid
> JIT_USER=jabberd2
> JIT_EXEC=/usr/libexec/pyicq-t/PyICQt.py
> в start прописано:
> start_daemon \
> --lockfile "$LOCKFILE" \
> --pidfile "$PIDFILE" \
> --user "$JIT_USER" \
> -- "$JIT_EXEC" -b -c "$JIT_CONF"
> RETVAL=$?
> в stop:
> stop_daemon \
> --lockfile "$LOCKFILE" \
> --pidfile "$PIDFILE" \
> --expect-user "$JIT_USER" \
> -- "$JIT_EXEC"
> RETVAL=$?
> и в status:
> status \
> --pidfile "$PIDFILE" \
> --expect-user "$JIT_USER" \
> -- "$JIT_EXEC"
> RETVAL=$?
>
> стартует нормально, а вот стоп - не работает. и статус тоже говорит что процесс "стоппед" (PyICQt.py is stopped)
> мне кажется это из-за того, что при старте PyICQt.py стартует (и впоследствии висит в процессах) python, и он уже в свою очередь запускает pyicqt'шный main
>
> Что нужно прописать в stop_daemon и status что-б они работали?
Как вы понимаете, работающий процесс, который будут искать start_daemon,
stop_daemon и status - это python. Но start_daemon, stop_daemon и status
этого не знают, их нужно проинформировать:
start_daemon --name python
stop_daemon python (python вместо $JIT_EXEC")
status python (python вместо $JIT_EXEC")
Если хотите красоты, до добавьте ещё для каждой из них
--displayname "$JIT_EXEC"
Это всё при условии, что $PIDFILE заполнен правильно.
--
ldv
[-- Attachment #2: Type: application/pgp-signature, Size: 191 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Comm] start_daemon и stop_daemon
2006-06-14 22:27 ` Dmitry V. Levin
@ 2006-06-15 4:22 ` Alexey Sidorov
2006-06-15 4:57 ` Nikolay A. Fetisov
0 siblings, 1 reply; 11+ messages in thread
From: Alexey Sidorov @ 2006-06-15 4:22 UTC (permalink / raw)
To: ALT Linux Community
Dmitry V. Levin пишет:
> Как вы понимаете, работающий процесс, который будут искать start_daemon,
> stop_daemon и status - это python. Но start_daemon, stop_daemon и status
> этого не знают, их нужно проинформировать:
>
> start_daemon --name python
> stop_daemon python (python вместо $JIT_EXEC")
> status python (python вместо $JIT_EXEC")
>
> Если хотите красоты, до добавьте ещё для каждой из них
> --displayname "$JIT_EXEC"
>
> Это всё при условии, что $PIDFILE заполнен правильно.
>
start()
{
# start daemon
start_daemon \
--lockfile "$LOCKFILE" \
--pidfile "$PIDFILE" \
--user "$JIT_USER" \
--name python \
--displayname "$JIT_EXEC" \
-- "$JIT_EXEC" -b -c "$JIT_CONF"
RETVAL=$?
}
stop()
{
stop_daemon \
--lockfile "$LOCKFILE" \
--pidfile "$PIDFILE" \
--expect-user "$JIT_USER" \
--displayname "$JIT_EXEC" \
-- python
RETVAL=$?
}
status \
--pidfile "$PIDFILE" \
--expect-user "$JIT_USER" \
--displayname "$JIT_EXEC" \
-- python
RETVAL=$?
[root@www ~]# service jabberd2-pyicq status
/usr/libexec/pyicq-t/PyICQt.py is stopped
[root@www ~]# service jabberd2-pyicq stop
Service /usr/libexec/pyicq-t/PyICQt.py is not running. [PASSED]
[root@www ~]# ps -A|grep py
25574 ? 00:00:02 python
25584 ? 00:00:00 python
и в $PIDFILE соответственно 25574
--
С уважением, Алексей Сидоров
mailto:alex@reutman.ru
JIT:alexsid@jabber.ru
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Comm] start_daemon и stop_daemon
2006-06-15 4:22 ` Alexey Sidorov
@ 2006-06-15 4:57 ` Nikolay A. Fetisov
2006-06-15 5:20 ` Alexey Sidorov
0 siblings, 1 reply; 11+ messages in thread
From: Nikolay A. Fetisov @ 2006-06-15 4:57 UTC (permalink / raw)
To: community
On Thu, 15 Jun 2006 08:22:43 +0400
Alexey Sidorov wrote:
> ......
> status \
> --pidfile "$PIDFILE" \
> --expect-user "$JIT_USER" \
> --displayname "$JIT_EXEC" \
> -- python
> RETVAL=$?
>
> [root@www ~]# service jabberd2-pyicq status
> /usr/libexec/pyicq-t/PyICQt.py is stopped
> [root@www ~]# service jabberd2-pyicq stop
> Service /usr/libexec/pyicq-t/PyICQt.py is not running. [PASSED]
> [root@www ~]# ps -A|grep py
> 25574 ? 00:00:02 python
> 25584 ? 00:00:00 python
>
> и в $PIDFILE соответственно 25574
pyICQt точно работает под пользователем $JIT_USER ? В качестве имени
процесса, возможно, требуется использовать полностью '/usr/bin/python'.
Лучше смотреть на вывод 'ps aux', он намного информативнее.
--
С уважением,
Николай Фетисов
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Comm] start_daemon и stop_daemon
2006-06-15 4:57 ` Nikolay A. Fetisov
@ 2006-06-15 5:20 ` Alexey Sidorov
2006-06-15 7:10 ` Nikolay A. Fetisov
0 siblings, 1 reply; 11+ messages in thread
From: Alexey Sidorov @ 2006-06-15 5:20 UTC (permalink / raw)
To: ALT Linux Community
Nikolay A. Fetisov пишет:
> On Thu, 15 Jun 2006 08:22:43 +0400
> Alexey Sidorov wrote:
>> ......
>> status \
>> --pidfile "$PIDFILE" \
>> --expect-user "$JIT_USER" \
>> --displayname "$JIT_EXEC" \
>> -- python
>> RETVAL=$?
>>
>> [root@www ~]# service jabberd2-pyicq status
>> /usr/libexec/pyicq-t/PyICQt.py is stopped
>> [root@www ~]# service jabberd2-pyicq stop
>> Service /usr/libexec/pyicq-t/PyICQt.py is not running. [PASSED]
>> [root@www ~]# ps -A|grep py
>> 25574 ? 00:00:02 python
>> 25584 ? 00:00:00 python
>>
>> и в $PIDFILE соответственно 25574
>
> pyICQt точно работает под пользователем $JIT_USER ? В качестве имени
> процесса, возможно, требуется использовать полностью '/usr/bin/python'.
>
> Лучше смотреть на вывод 'ps aux', он намного информативнее.
>
[root@www ~]# ps aux|grep python
jabberd2 16964 2.3 2.4 14128 9308 pts/6 S 08:29 1:08 python /usr/libexec/pyicq-t/PyICQt.py -b -c /etc/jabberd2/pyicq.xml
jabberd2 16974 0.0 2.4 14128 9308 pts/6 S 08:29 0:00 python /usr/libexec/pyicq-t/PyICQt.py -b -c /etc/jabberd2/pyicq.xml
status \
--pidfile "$PIDFILE" \
--expect-user "$JIT_USER" \
--displayname "$JIT_EXEC" \
-- python "$JIT_EXEC" -b -c "$JIT_CONF"
не помогает :(
--
С уважением, Алексей Сидоров
mailto:alex@reutman.ru
JIT:alexsid@jabber.ru
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Comm] start_daemon и stop_daemon
2006-06-15 5:20 ` Alexey Sidorov
@ 2006-06-15 7:10 ` Nikolay A. Fetisov
2006-06-15 7:48 ` Alexey Sidorov
2006-06-15 9:41 ` Vladimir V. Kamarzin
0 siblings, 2 replies; 11+ messages in thread
From: Nikolay A. Fetisov @ 2006-06-15 7:10 UTC (permalink / raw)
To: community
On Thu, 15 Jun 2006 09:20:37 +0400
Alexey Sidorov wrote:
> ......
> не помогает :(
Для имеющегося в Sisyphus pyicq-t-0.7a-alt2 у меня стартовый
скрипт сейчас заработал в таком варианте:
......
JIT_CONF=/usr/share/pyicq-t/config.xml
LOCKFILE=/var/lock/subsys/jabberd2-pyicq
PIDFILE=/var/run/pyicq-t/pyicq-t.pid
JIT_USER=root
JIT_EXEC=/usr/sbin/pyicq-t
# Конфиг - из пакета, я его не менял и не переносил в /etc/
# LOCKFILE - при запуске сервиса не создаётся
# JIT_USER - на jabber2 не менял
start()
{
# start daemon
start_daemon \
--pidfile "$PIDFILE" \
--user "$JIT_USER" \
--name python \
--displayname "$JIT_EXEC" \
-- "$JIT_EXEC" -b -c "$JIT_CONF"
RETVAL=$?
}
stop()
{
stop_daemon \
--pidfile "$PIDFILE" \
--expect-user "$JIT_USER" \
--displayname "$JIT_EXEC" \
-- python
RETVAL=$?
}
show_status()
{
status \
--pidfile "$PIDFILE" \
--expect-user "$JIT_USER" \
--displayname "$JIT_EXEC" \
-- python
RETVAL=$?
}
......
[JT] А вообще этот вопрос сильно не по тематике данной рассылки.
--
С уважением,
Николай Фетисов
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Comm] start_daemon и stop_daemon
2006-06-15 7:10 ` Nikolay A. Fetisov
@ 2006-06-15 7:48 ` Alexey Sidorov
2006-06-15 9:41 ` Vladimir V. Kamarzin
1 sibling, 0 replies; 11+ messages in thread
From: Alexey Sidorov @ 2006-06-15 7:48 UTC (permalink / raw)
To: ALT Linux Community
Nikolay A. Fetisov пишет:
> On Thu, 15 Jun 2006 09:20:37 +0400
> Alexey Sidorov wrote:
>> ......
>> не помогает :(
>
> Для имеющегося в Sisyphus pyicq-t-0.7a-alt2 у меня стартовый
> скрипт сейчас заработал в таком варианте:
>
> ......
> JIT_CONF=/usr/share/pyicq-t/config.xml
> LOCKFILE=/var/lock/subsys/jabberd2-pyicq
> PIDFILE=/var/run/pyicq-t/pyicq-t.pid
> JIT_USER=root
> JIT_EXEC=/usr/sbin/pyicq-t
> # Конфиг - из пакета, я его не менял и не переносил в /etc/
> # LOCKFILE - при запуске сервиса не создаётся
> # JIT_USER - на jabber2 не менял
>
> start()
> {
> # start daemon
> start_daemon \
> --pidfile "$PIDFILE" \
> --user "$JIT_USER" \
> --name python \
> --displayname "$JIT_EXEC" \
> -- "$JIT_EXEC" -b -c "$JIT_CONF"
> RETVAL=$?
> }
> stop()
> {
> stop_daemon \
> --pidfile "$PIDFILE" \
> --expect-user "$JIT_USER" \
> --displayname "$JIT_EXEC" \
> -- python
> RETVAL=$?
> }
> show_status()
> {
> status \
> --pidfile "$PIDFILE" \
> --expect-user "$JIT_USER" \
> --displayname "$JIT_EXEC" \
> -- python
> RETVAL=$?
> }
> ......
>
> [JT] А вообще этот вопрос сильно не по тематике данной рассылки.
>
может дело в руте?
у меня pyicq-t 0.7b с родного сайта, но это наверное дела не меняет...
А в какую рассылку?
--
С уважением, Алексей Сидоров
mailto:alex@reutman.ru
JIT:alexsid@jabber.ru
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Comm] start_daemon и stop_daemon
2006-06-15 7:10 ` Nikolay A. Fetisov
2006-06-15 7:48 ` Alexey Sidorov
@ 2006-06-15 9:41 ` Vladimir V. Kamarzin
2006-06-15 9:56 ` Alexey Sidorov
2006-06-15 10:30 ` Nikolay A. Fetisov
1 sibling, 2 replies; 11+ messages in thread
From: Vladimir V. Kamarzin @ 2006-06-15 9:41 UTC (permalink / raw)
To: ALT Linux Community
>>>>> On 15 Jun 2006 at 13:10 "NAF" == Nikolay A Fetisov writes:
>> ......
>> не помогает :(
NAF> Для имеющегося в Sisyphus pyicq-t-0.7a-alt2 у меня стартовый
NAF> скрипт сейчас заработал в таком варианте:
Повесьте пожалуйста в бугзиллу FR с приложенным скриптом
--
vvk
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Comm] start_daemon и stop_daemon
2006-06-15 9:41 ` Vladimir V. Kamarzin
@ 2006-06-15 9:56 ` Alexey Sidorov
2006-06-15 21:31 ` Dmitry V. Levin
2006-06-15 10:30 ` Nikolay A. Fetisov
1 sibling, 1 reply; 11+ messages in thread
From: Alexey Sidorov @ 2006-06-15 9:56 UTC (permalink / raw)
To: ALT Linux Community
Vladimir V. Kamarzin пишет:
> Повесьте пожалуйста в бугзиллу FR с приложенным скриптом
Сорри, разобрался....
просто pid файл имел не то имя (в init скрипте и конфиге pyicq-t разные
имена pid-файлов были)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Comm] start_daemon и stop_daemon
2006-06-15 9:41 ` Vladimir V. Kamarzin
2006-06-15 9:56 ` Alexey Sidorov
@ 2006-06-15 10:30 ` Nikolay A. Fetisov
1 sibling, 0 replies; 11+ messages in thread
From: Nikolay A. Fetisov @ 2006-06-15 10:30 UTC (permalink / raw)
To: community
On Thu, 15 Jun 2006 15:41:58 +0600
Vladimir V. Kamarzin wrote:
> >>>>> On 15 Jun 2006 at 13:10 "NAF" == Nikolay A Fetisov writes:
>
> >> ......
> >> не помогает :(
>
> NAF> Для имеющегося в Sisyphus pyicq-t-0.7a-alt2 у меня стартовый
> NAF> скрипт сейчас заработал в таком варианте:
>
> Повесьте пожалуйста в бугзиллу FR с приложенным скриптом
Есть несколько но:
- под "заработал" понимались разумные ответы на 'stop' и 'status', и не
более того;
- в имеющемся скрипте, сделанном за пять минут из template и кусков из
писем этого обсуждения, кроме start, stop и status больше ничего нет,
начиная с заголовка для chkconfig;
- и у меня нет рабочей установки pyicq-t, на которой можно было бы
доработать этот скрипт до более-менее приличного вида :-)
Так что если нужен FR - то это скорее к Алексею, ну или могу выслать
имеющуюся болванку. А так ограничусь только #9700.
--
С уважением,
Николай Фетисов
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-06-15 21:31 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-14 12:50 [Comm] start_daemon и stop_daemon Alexey Sidorov
2006-06-14 22:27 ` Dmitry V. Levin
2006-06-15 4:22 ` Alexey Sidorov
2006-06-15 4:57 ` Nikolay A. Fetisov
2006-06-15 5:20 ` Alexey Sidorov
2006-06-15 7:10 ` Nikolay A. Fetisov
2006-06-15 7:48 ` Alexey Sidorov
2006-06-15 9:41 ` Vladimir V. Kamarzin
2006-06-15 9:56 ` Alexey Sidorov
2006-06-15 21:31 ` Dmitry V. Levin
2006-06-15 10:30 ` Nikolay A. Fetisov
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git