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