Thread: Pipe fixes for win32 services

Pipe fixes for win32 services

From
"Magnus Hagander"
Date:
Here is a patch that fixes the pipes used in find_other_exec() when
running as a service on windows <= 2000. Required to make the pg_ctl
service wrapper to work at all.

//Magnus

Attachment

Re: Pipe fixes for win32 services

From
Bruce Momjian
Date:
This needs to be applied soon so the installer can be tested.

Your patch has been added to the PostgreSQL unapplied patches list at:

    http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

---------------------------------------------------------------------------


Magnus Hagander wrote:
> Here is a patch that fixes the pipes used in find_other_exec() when
> running as a service on windows <= 2000. Required to make the pg_ctl
> service wrapper to work at all.
>
> //Magnus

Content-Description: exec_pipe.patch

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: Pipe fixes for win32 services

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> This needs to be applied soon so the installer can be tested.

I can't speak to the details of the Windows process-launch code,
but it looked okay to me otherwise.

One point: if I understood correctly, this is necessary only for
Windows 2000, because we've already blown off the thought of
supporting any older Windows versions, no?  If we later decide
we can't support W2K either, this would be a pretty large chunk
of code that we could pull out.  Please make sure it's clearly
labeled as "useful only as long as we support Windows 2000".

            regards, tom lane

Re: Pipe fixes for win32 services

From
Bruce Momjian
Date:
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > This needs to be applied soon so the installer can be tested.
>
> I can't speak to the details of the Windows process-launch code,
> but it looked okay to me otherwise.
>
> One point: if I understood correctly, this is necessary only for
> Windows 2000, because we've already blown off the thought of
> supporting any older Windows versions, no?  If we later decide
> we can't support W2K either, this would be a pretty large chunk
> of code that we could pull out.  Please make sure it's clearly
> labeled as "useful only as long as we support Windows 2000".

Yep, I had him add this comment:

+  * The runtime librarys popen() on win32 does not work when being
+  * called from a service when running on windows <= 2000, because
+  * there is no stdin/stdout/stderr.

I think we support NT too, hence the <= 2000.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: Pipe fixes for win32 services

From
"Magnus Hagander"
Date:
>Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> This needs to be applied soon so the installer can be tested.
>
>I can't speak to the details of the Windows process-launch code,
>but it looked okay to me otherwise.
>
>One point: if I understood correctly, this is necessary only for
>Windows 2000, because we've already blown off the thought of
>supporting any older Windows versions, no?

No, NT4 is also on our list of supported versions.

> If we later decide
>we can't support W2K either, this would be a pretty large chunk
>of code that we could pull out.  Please make sure it's clearly
>labeled as "useful only as long as we support Windows 2000".

It is, in the comment preceding the code.

//Magnus

Re: Pipe fixes for win32 services

From
Claudio Natoli
Date:
Tom Lane writes:
> I can't speak to the details of the Windows process-launch code,

FWIW, it checks out fine to me.

Cheers,
Claudio

---
Certain disclaimers and policies apply to all email sent from Memetrics.
For the full text of these disclaimers and policies see
<a
href="http://www.memetrics.com/emailpolicy.html">http://www.memetrics.com/em
ailpolicy.html</a>

Re: Pipe fixes for win32 services

From
Bruce Momjian
Date:
Patch applied.  Thanks.

---------------------------------------------------------------------------


Magnus Hagander wrote:
> Here is a patch that fixes the pipes used in find_other_exec() when
> running as a service on windows <= 2000. Required to make the pg_ctl
> service wrapper to work at all.
>
> //Magnus

Content-Description: exec_pipe.patch

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073