Re: postgresql-[any version] from FreeBSD ports - startup problems after crash - Mailing list pgsql-bugs

From Jim C. Nasby
Subject Re: postgresql-[any version] from FreeBSD ports - startup problems after crash
Date
Msg-id 20060515190033.GX26212@pervasive.com
Whole thread Raw
In response to Re: postgresql-[any version] from FreeBSD ports - startup problems after crash  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: postgresql-[any version] from FreeBSD ports - startup problems after crash
List pgsql-bugs
On Mon, May 15, 2006 at 09:23:33AM -0400, Tom Lane wrote:
> We've fixed this in recent releases by having the postmaster also check
> for a match to its parent process ID (getppid).  The care in the start
> script comes because this only works for one level up.  Therefore, you
> can't "su -c pg_ctl start ..." because that would create three levels of
> postgres-owned processes (shell, pg_ctl, postmaster) and if the PID
> count is off by 2 instead of 1 then we still lose.  You have to invoke
> the postmaster directly, "su -c postmaster ...".  (Hm, actually it might
> work to do "su -c 'exec pg_ctl ...'" ... I have not tried that.)

Except that the shell that's running su would be root, not pgsql, at
least in the case of FreeBSD. The guts of the current port's rc.d file
are:

su -l ${postgresql_user} -c "exec ${command} ${command_args} ${rc_arg}"
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

pgsql-bugs by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: BUG #2437: Rules for COPY
Next
From: Tom Lane
Date:
Subject: Re: postgresql-[any version] from FreeBSD ports - startup problems after crash