bucardo/bucardo — pull request #43 by mnp (2013-03-27 18:32:10+00:00)
Title: The regex looking at ps output when killing children didn't match the children

The regex looking at ps output when killing children didn't match the children. We were getting this message (whitespace retained) in our installation to a nonstandard location using INSTALL_BASE:

MCP Will not kill process 14723: ps args is not 'Bucardo', got: COMMAND COMMAND

and "bucardo stop" was hit or miss, with failure to kill processes. Our process tree looks like this usually (Solaris 10):

root 28401 0.0 0.11948814864 ? S 13:44:19 0:00 perl /foo/bar/bin/bucardo start --log-destination=/pig/dog/logs --log-ex
postgres 28402 0.0 3.9619776613960 ? S 13:44:19 0:00 postgres: bucardo bucardo [local] idle
root 28406 0.0 0.11948815384 ? S 13:44:19 0:00 perl /foo/bar/bin/bucardo start --log-destination=/pig/dog/logs --log-ex
postgres 28407 0.0 3.9619776614088 ? S 13:44:19 0:00 postgres: bucardo bucardo [local] idle
root 28410 0.0 0.11948815632 ? S 13:44:19 0:00 perl /foo/bar/bin/bucardo start --log-destination=/pig/dog/logs --log-ex

The way the Bucardo ps check sees it with "ps -p $pid -o comm,args" looks like this:

COMMAND COMMAND
perl perl /foo/bar/bin/bucardo start --log-destination=/pig/dog/logs --log-ex

so the regex won't match \bBucardo\s.