Gentoo Archives: gentoo-user-ru

From: Sergey Kobzar <sergey.kobzar@××××.ru>
To: gentoo-user-ru@l.g.o
Subject: Re: [gentoo-user-ru] Re: [gentoo-user-ru] Два инстанса Sphinx
Date: Thu, 06 Jun 2013 15:17:01
Message-Id: 51B0A7E8.7080403@mail.ru
In Reply to: [gentoo-user-ru] Re: [gentoo-user-ru] Два инстанса Sphinx by "Андрей Буров"
1 On 06/06/13 10:02, Андрей Буров wrote:
2 > Доброго времени суток
3 > Поменяйте в скриптах:
4 > start:
5 > start-stop-daemon --start --make-pidfile --pidfile
6 > /var/run/sphinx-test.pid --exec /usr/bin/searchd -- --config
7 > /etc/sphinx/sphinx-test.conf
8 >
9 > stop:
10 > start-stop-daemon --stop --pidfile /var/run/sphinx-test.pid
11
12 Сделал. Все-равно /etc/init.d/searchd stop останавливает 2 процесса.
13
14 После старта (запускаются демоны разными скриптами):
15 21467 ? S 0:00 /usr/bin/searchd
16 21468 ? Sl 0:00 /usr/bin/searchd
17 21485 ? S 0:00 /usr/bin/searchd --config
18 /etc/sphinx/sphinx-test.conf
19 21486 ? Sl 0:18 /usr/bin/searchd --config
20 /etc/sphinx/sphinx-test.conf
21
22
23 Оригинальный скрипт /etc/init.d/searchd:
24 #!/sbin/runscript
25 # Copyright 1999-2004 Gentoo Foundation
26 # Distributed under the terms of the GNU General Public License v2
27 # $Header: /var/cvsroot/gentoo-x86/app-misc/sphinx/files/searchd.rc,v
28 1.1 2009/11/05 15:41:56 graaff Exp $
29
30 depend() {
31 need net
32 use logger
33 }
34
35 checkconfig() {
36 if [ ! -f /etc/sphinx/sphinx.conf ] ; then
37 eerror "Please create /etc/sphinx/sphinx.conf"
38 eerror "Sample conf: /etc/sphinx/sphinx.conf.dist"
39 return 1
40 fi
41 return 0
42 }
43
44 start() {
45 checkconfig || return $?
46
47 ebegin "Starting sphinx searchd"
48 start-stop-daemon --start --exec /usr/bin/searchd
49 eend $? "Failed to start sphinx searchd"
50 }
51
52 stop() {
53 ebegin "Stopping sphinx searchd"
54 start-stop-daemon --stop --exec /usr/bin/searchd
55 eend $? "Failed to stop sphinx searchd"
56 }
57
58 Скрипт для второго инстанса /etc/init.d/searchd-test:
59 #!/sbin/runscript
60
61
62 depend() {
63 need net
64 use logger
65 }
66
67 checkconfig() {
68 if [ ! -f /etc/sphinx/sphinx-test.conf ]; then
69 eerror "Please create /etc/sphinx/sphinx-test.conf"
70 eerror "Sample conf: /etc/sphinx/sphinx.conf.dist"
71 return 1
72 fi
73 return 0
74 }
75
76 start() {
77 checkconfig || return $?
78
79 ebegin "Starting sphinx searchd"
80 start-stop-daemon --start --make-pidfile --pidfile
81 /run/searchd-test.pid --exec /usr/bin/searchd -- --config
82 /etc/sphinx/sphinx-test.conf
83 eend $? "Failed to start sphinx searchd"
84 }
85
86 stop() {
87 ebegin "Stopping sphinx searchd"
88 start-stop-daemon --stop --pidfile /run/searchd-test.pid
89 eend $? "Failed to stop sphinx searchd"
90 }
91
92
93 Может первому первому скрпту надо сказат --make-pidfile --pidfile
94 /run/searchd-test.pid?
95
96 Кстати, а зачем --make-pidfile, если демон сам их создает:
97
98 # cat /etc/sphinx/sphinx.conf | grep pid
99 pid_file = /run/searchd.pid
100
101 # cat /etc/sphinx/sphinx-test.conf | grep pid
102 pid_file = /run/searchd-test.pid
103
104 ?

Replies

Subject Author
[gentoo-user-ru] Re: [gentoo-user-ru] Re: [gentoo-user-ru] Два инстанса Sphinx "Андрей Буров" <burik666@×××××.com>