Skip site navigation (1) Skip section navigation (2)

Re: How to check postgres running or not ?

From: Christopher Browne <cbbrowne(at)acm(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to check postgres running or not ?
Date: 2004-09-20 01:33:00
Message-ID: m3llf5pvw3.fsf@wolfe.cbbrowne.com (view raw or flat)
Thread:
Lists: pgsql-sql
Clinging to sanity, worik(at)noggon(dot)com (Worik) mumbled into her beard:
> [snip]
>> Just to enforce the test is better looking for the entire executable
>> path:
>>         ps aux | grep /usr/bin/postmaster | grep -v grep
>>
>
> Does not work for me!
>
> worik(at)stolberg:~$ ps aux | grep /usr/bin/postmaster | grep -v grep
> worik(at)stolberg:~$ ps aux | grep postmaster | grep -v grep
> postgres   670  0.1  0.6  8544 1688 pts/1    S    12:33   0:00
> /usr/lib/postgresql/bin/postmaster
> worik(at)stolberg:~$
>
> So...
> " ps aux | grep postmaster | grep -v grep "
> is more reliable(?)

There's a very slightly clever modification that gets rid of the extra
grep...

Try.. 

 [appropriate ps command for your platform] | egrep '[p]ostmaster'

That egrep _won't_ match its own command line.
-- 
let name="cbbrowne" and tld="ntlug.org" in String.concat "@" [name;tld];;
http://www3.sympatico.ca/cbbrowne/multiplexor.html
He doesn't have much of a reputation, or so I've heard. 

In response to

Responses

pgsql-sql by date

Next:From: Arne StoelckDate: 2004-09-20 02:33:03
Subject: Re: How to check postgres running or not ?
Previous:From: Tom LaneDate: 2004-09-20 01:11:31
Subject: Re: How to check postgres running or not ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group