184 |
raise RuntimeError("postmaster didn't start") |
raise RuntimeError("postmaster didn't start") |
185 |
|
|
186 |
def is_running(self): |
def is_running(self): |
187 |
"""Return true a postmaster process is running on self.dbdir |
"""Return whether a postmaster process is running on self.dbdir |
188 |
|
|
189 |
This method runs pg_ctl status on the dbdir so even if the |
This method runs pg_ctl status on the dbdir and returns True if |
190 |
object has just been created it is possible that this method |
that command succeeds and False otherwise. |
191 |
returns true if there's still a postmaster process running for |
|
192 |
self.dbdir. |
Note that it is possible that this method returns true even if |
193 |
|
the PostgreSQLServer instance has just been created and |
194 |
|
createdb() has not been called yet. This can happen, for |
195 |
|
instance, if the server has been started manually for debugging |
196 |
|
purposes after a test suite run. |
197 |
""" |
""" |
198 |
return run_boolean_command(["pg_ctl", "-D", self.dbdir, "status"]) |
return run_boolean_command(["pg_ctl", "-D", self.dbdir, "status"]) |
199 |
|
|