[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Regarding haproxy package init script bug!


I found a problem when doing `/etc/init.d/haproxy stop` whenever the
`nbproc` value is set to any value greater than 1 that only one
process gets terminated from the total defined number of `nbproc`, So
let's say we set nbproc value to 2 and try to restart haproxy, 2
separate _mother_ processes will be created and their pids will be
listed /var/run/haproxy.pid in separate lines, Actually I am totally
convinced that it is technically a bug within haproxy as they should
be having some sort of mother process which fork as many child
processes as needed and distribute them among processors but also
after evaluating how the init script tend to stop the processes it
seems that it is using the function killproc from
/etc/rc.d/init.d/functions which if it did have some sort of a loop to
get all new line separated pids from pid files and terminate them in
order would've been a solution as it's not the first time I see a pid
file listing pids for a number of processes, but there could also be
another number of solution regarding this issue.

To fix this issue _temporarily_

I replaced the line where it says `killproc $prog` with the following.

for i in $(cat /var/run/$prog.pid); do
        kill -9 $i; done

Which should be a temporarily fix.

Thanks, /Ahmed Medhat/

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]