Re: win2k, service, pg_ctl, popen, etc

"Magnus Hagander" <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.win32
Message-ID <[email protected]>
Following up to myself, I found these references:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&safe=off&threadm=3475
F130.80F%40us.ibm.com&rnum=1&prev=/groups%3Fq%3Dwin32%2Bpopen%2Bservice%
26hl%3Den%26lr%3D%26ie%3DUTF-8%26safe%3Doff%26selm%3D3475F130.80F%2540us
.ibm.com%26rnum%3D1

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&safe=off&threadm=5f4a
rb%24q5n%40chaos.dac.neu.edu&rnum=7&prev=/groups%3Fq%3Dwin32%2Bpopen%2Bs
ervice%26hl%3Den%26lr%3D%26ie%3DUTF-8%26safe%3Doff%26selm%3D5f4arb%2524q
5n%2540chaos.dac.neu.edu%26rnum%3D7


Seems we need to either write our own version of popen(), or we need to
do a system("whatever > somefile") and then read the file...

//Magnus

>-----Original Message-----
>
>
>Hi!
>
>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...
>
>Thoughts?
>
>//Magnus
>
>
>---------------------------(end of 
>broadcast)---------------------------
>TIP 3: if posting/reading through Usenet, please send an appropriate
>      subscribe-nomail command to [email protected] so that your
>      message can get through to the mailing list cleanly
>

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.