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

win2k, service, pg_ctl, popen, etc

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: <pgsql-hackers-win32(at)postgresql(dot)org>
Cc: "Claudio Natoli" <claudio(dot)natoli(at)memetrics(dot)com>
Subject: win2k, service, pg_ctl, popen, etc
Date: 2004-07-20 20:40:32
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers-win32

Been trying to find out why things don't work well on Windows 2000. The
closest I've come to a solution is that popen() does not work on windows
2000 *when running as a service*. This isused in find_other_exec(),
which is what pg_ctl uses to find postmaster.exe. It does appear to work
fine on XP and 2003. Haven't tested NT4.
The symptoms are popen() returning NULL, with both errno and
GetLastError() set to 0.

Anyone know *why* this doesn't work?

If we don't know why, sign one more down as a bug in mingw (hardly
surprising - just the area of pipes and consoles seems to be where it's
weak). In that case, why not just recode pg_ctl to execute
postmaster.exe from the same directory it found pg_ctl.exe in. This can
easily be done using GetModuleFileName(). Is a pipe opened at any other
place? Or does other places need to be fixed as well (I haven't gone
through the whole code).

Oh, and also - has *anybody* got the service running wit hpg_ctl as
service wrapper on windows 2000? In that case, it's version or
environment dependent...




pgsql-hackers-win32 by date

Next:From: Magnus HaganderDate: 2004-07-20 20:53:41
Subject: Re: win2k, service, pg_ctl, popen, etc
Previous:From: Bruce MomjianDate: 2004-07-20 18:36:14
Subject: Re: [HACKERS] Cannot initdb in cvs tip

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