This repository was archived by the owner on Aug 29, 2018. It is now read-only.
Commit 203d57b
committed
Kill haproxy during restart even when pid does not exist
Bug 1211526
https://bugzilla.redhat.com/show_bug.cgi?id=1211526
The haproxy process was not killed with pkill as expected due to a logging message being reported instead of returning non-zero at the end of the `_stop_haproxy_service` function. `pkill` is now run if the haproxy process still exists after the stop during a restart.
The `_stop_haproxy_ctld` method was setting $pid to the haproxy_ctld pid. This same variable is set in `_stop_haproxy_service` only if the haproxy pid file does exist. If the haproxy pid file doesn't exist, the $pid variable still contains the haproxy_ctld pid, causing us to assume that the haproxy pid file does exist.
The stop function would report that the haproxy instance is stopped when the haproxy pid files does not exist. Now `stop()` attempts to force-kill the haproxy instance if the process is still running, whether the pid file exists or not.
Lastly, modified several `echo` statements to use the sdk's client_* methods. This ensures that the user perfoming these actions using rhc will receive the message in the rhc output.1 parent 123da46 commit 203d57b
1 file changed
Lines changed: 30 additions & 12 deletions
Lines changed: 30 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
159 | 163 | | |
160 | 164 | | |
161 | 165 | | |
| |||
175 | 179 | | |
176 | 180 | | |
177 | 181 | | |
178 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
179 | 188 | | |
180 | 189 | | |
181 | 190 | | |
182 | 191 | | |
183 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
184 | 202 | | |
185 | 203 | | |
186 | 204 | | |
187 | 205 | | |
188 | | - | |
| 206 | + | |
189 | 207 | | |
190 | 208 | | |
191 | 209 | | |
| |||
196 | 214 | | |
197 | 215 | | |
198 | 216 | | |
199 | | - | |
| 217 | + | |
200 | 218 | | |
201 | 219 | | |
202 | 220 | | |
203 | 221 | | |
204 | | - | |
| 222 | + | |
205 | 223 | | |
206 | | - | |
| 224 | + | |
207 | 225 | | |
208 | 226 | | |
209 | 227 | | |
| |||
0 commit comments