Re: postgresql as windows 2000 service problem - Mailing list pgsql-hackers-win32

From Steve Holdoway
Subject Re: postgresql as windows 2000 service problem
Date
Msg-id 40F72798.4010306@treshna.com
Whole thread Raw
In response to Re: postgresql as windows 2000 service problem  ("Magnus Hagander" <mha@sollentuna.net>)
List pgsql-hackers-win32
Magnus Hagander wrote:

>>I have downloaded the binary snapshot from 13/7/2004 I have
>>created a user postgres and give him log on as service right
>>As user postgres I unzipped the binary snapshot to
>>c:\postgres As Administrator I add to path c:\postgres\bin
>>and c:\postgres\lib As postgres I run with success initdb -L
>>"c:/postgres/share"
>>As postgres I can run (with success) pg_ctl start and pg_ctl
>>stop As Administrator I run pg_ctl register -U postrges -P
>>xxxxxx As Administtrator if i give net start postgresql I get
>>the error 1067
>>
>>
>
>Ok: Error 1067 is "The process terminated unexpectedly.". Looks like
>pg_ctl or the postmaster just fell over.
>
>Do you get any entries in the event log? And make sure you have enabled
>eventlog logging in postgresql.conf (off by default).
>
>
>
>
>>I have done the same things in windows xp and everything worked fine.
>>The only difference I note is that in windows xp the user
>>name in service postgresql is SERVER\postgres. In windows
>>2000 is .\postgres.
>>
>>
>
>They should be equivalant, and shouldn't have any effect on this.
>
>//Magnus
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>
>
I've been doing a bit of digging...

Latest snapshot, mingw with gcc 3.3.1. configure --without-zlib.

in <home>/src/bin/pg_ctl, within the generated exec.c code.

Line 313, runs popen "<dir>postmaster.exe" -V 2>nul to get version info
as a check to see if it can find the program. This is returning a null
file descriptor, as well as errno being set to 0 as well... now that
informative!

I don't think the code is at fault here ( I've tried all the obvious
things, including mangling the command string in any way I can think of,
except for a windows version of adding sh -c at the start, if there is
one... also playing around with popen open modes ), but it needs someone
with far better Windoze programming skils than me to sort it out ):

Hopefully this will make some sense to someone.

Cheers,

Steve



pgsql-hackers-win32 by date:

Previous
From: "Laurent Ballester"
Date:
Subject: Re: postgresql as windows 2000 service problem
Next
From: kranas@freemail.gr
Date:
Subject: postgresql as windows 2000 service problem