bugzilla-daemon at main.slony.info bugzilla-daemon at main.slony.info
Mon Jul 29 04:31:21 PDT 2013
http://www.slony.info/bugzilla/show_bug.cgi?id=307

           Summary: slon-tools.pm get_pid function uses "ps | egrep" badly
           Product: Slony-I
           Version: 2.0
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: low
         Component: altperl
        AssignedTo: slony1-bugs at lists.slony.info
        ReportedBy: p.mayers at imperial.ac.uk
                CC: slony1-bugs at lists.slony.info
   Estimated Hours: 0.0


The "get_pid" function for slon-tools.pm tries to find a running "slon" for a
given node by doing this:

 ps | egrep "host=$dbhost dbname=$dbname.*port=$dbport"

The ".*" on the end of the dbname means that weird stuff happens if you have a
set of nodes like this:

 node1 host=127.0.0.1 dbname=testdb
 node2 host=127.0.0.1 dbname=testdb2
 node3 host=127.0.0.1 dbname=testdb3

Specifically, the success of slon_start is then order-dependent. This works:

 slon_start 1
 slon_start 2
 slon_start 3

...but this fails:

 slon_start 3
 slon_start 2
 slon_start 1 << fails with "slon already running"

I think you want a "\b" before the ".*" to indicate word boundary?

-- 
Configure bugmail: http://www.slony.info/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
You are the assignee for the bug.


More information about the Slony1-bugs mailing list