Re: [HACKERS] PID of backend - Mailing list pgsql-hackers

From Dmitry Samersoff
Subject Re: [HACKERS] PID of backend
Date
Msg-id XFMail.990602195243.dms@wplus.net
Whole thread Raw
In response to Re: [HACKERS] PID of backend  (Oleg Bartunov <oleg@sai.msu.su>)
Responses Re: [HACKERS] PID of backend
List pgsql-hackers
On 02-Jun-99 Oleg Bartunov wrote:
> On Wed, 2 Jun 1999, Dmitry Samersoff wrote:
> 
>> Date: Wed, 02 Jun 1999 18:56:55 +0400 (MSD)
>> From: Dmitry Samersoff <dms@wplus.net>
>> To: pgsql-hackers@postgreSQL.org
>> Subject: [HACKERS] PID of backend
>> 
>>  Hi World! 
>> 
>>  Does backend сreates pid file?
>> 
>>   Postgres 6.5 backend (current CVS) stop answering query
>> 
>>  >>> Jun  2 00:12:32 mail popper[17585]: PgSQL:ROLLBACK failed:
>>  >>> PQsendQuery()
>>  >>> There is no connection to the backend. 
>> 
>>  every 300 000 cursor allocation so I wish to restart it every 100 000
>>  is there a way to do it simple than 
>>    kill  `ps ax | awk .....`
> 
> Have you tried pidof postmaster ?
> kill `pidof postmaster` | ....
 I have no pidof on my computer but it's exactly the same solution.
I need something usable inside program other than scanning process table.
The best one -  add code to create postgres.5432.pid 
to backend startup.

It also is good way to automatically unlink socket file after 
backend crush. (read pidfile, check existence of process and remove file if no process
found)   


---
Dmitry Samersoff, dms@wplus.net, ICQ:3161705
http://devnull.wplus.net
* There will come soft rains ...


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] nonblocking lock?
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] PID of backend