Pipe fixes for win32 services

Started by Magnus Haganderabout 22 years ago7 messagespatches
Jump to latest
#1Magnus Hagander
magnus@hagander.net

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

Attachments:

exec_pipe.patchapplication/octet-stream; name=exec_pipe.patchDownload+139-18
#2Bruce Momjian
bruce@momjian.us
In reply to: Magnus Hagander (#1)
Re: Pipe fixes for win32 services

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
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#2)
Re: Pipe fixes for win32 services

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

#4Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#3)
Re: Pipe fixes for win32 services

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
#5Magnus Hagander
magnus@hagander.net
In reply to: Bruce Momjian (#4)
Re: Pipe fixes for win32 services

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

#6Claudio Natoli
claudio.natoli@memetrics.com
In reply to: Magnus Hagander (#5)
Re: Pipe fixes for win32 services

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>
#7Bruce Momjian
bruce@momjian.us
In reply to: Magnus Hagander (#1)
Re: Pipe fixes for win32 services

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