Summary: | slon-tools.pm get_pid function uses "ps | egrep" badly | ||
---|---|---|---|
Product: | Slony-I | Reporter: | p.mayers |
Component: | altperl | Assignee: | Christopher Browne <cbbrowne> |
Status: | ASSIGNED --- | ||
Severity: | minor | CC: | slony1-bugs |
Priority: | low | ||
Version: | 2.0 | ||
Hardware: | All | ||
OS: | Linux |
Description
p.mayers
2013-07-29 04:31:21 UTC
I should add - this is because "dbname.*" machines "dbname" as well as "dbname1", "dbname2" etc. The \b prevents this I wonder if this is perhaps totally the wrong approach altogether. This draws us deeper into a "world of hurt" where we are essentially requiring that database connection strings have a particular format, and that we are, in detail, parsing them. It heads towards more sophisticated Perl regular expressions, and while Perl is pretty good at that, people aren't necessarily good at reading, understanding, or debugging those! The "better" way I am thinking of would be to consult the appropriate PID file generated by ech slon process that would allow us to avoid using ps altogether. I'd like to poke at that a bit more; I'd be happy to hear other thoughts on the matter. |