Psql refusing to start as Win2000 Service - Mailing list pgsql-cygwin

From Pavel Hofman, inSITE, s.r.o.
Subject Psql refusing to start as Win2000 Service
Date
Msg-id Pine.LNX.4.10.10203161018470.32437-100000@server.insite.cz
Whole thread Raw
List pgsql-cygwin
Hi,

I have been struggling for days to start the latest  cygwin postgresql
7.2 as a service on Win2000 Professional. It runs standalone, but does
not want to start in the service mode.

This is what I did (following the docs and some good tips provided in
this newsgroup):

1. created the "postgres" user with "Log on as service" permissions.

2. started the CYGIPC as a service, run inder the postgres user - OK.

3. initdb - OK, no failure (when CYGIPC ran under the SYSTEM user,
initdb complained, but this way it runs smoothly)

4. Started postmaster from shell - runs OK, I can connect with psql
etc. - no problem. Runs OK when started from cygwin bash as well as
from Win command window.

5. Installed the service as an Administrator:

cygrunsrv --install postmaster --path /usr/bin/postmaster --args "-d 6
-D /usr/share/postgresql/data -i" --dep ipc-daemon --termsig TERM
--user postgres

The password I entered was OK, I even tried
cygrunsrv --install postmaster --path /usr/bin/postmaster --args "-d 6
-D /usr/share/postgresql/data -i" --dep ipc-daemon --termsig TERM
--user postgres -W "postgres"

where postgres is the password. I tried a wrong password and Win
complained - I assume that's not the problem.

When I want to start the service (net start postmaster or using GUI),
it says something like "Service could not start, but the application
did not return any error". I could not find any log (created by
postmaster or cygrunsrv), or relevant record in NT logs.

I tried to run the service as SYSTEM - it would not start sucessfully,
but at least put info into /var/log/postmaster.log about wrong
permissions in /usr/share/postgresql/data - that's corrent and I
assume postgresql would run OK from service under SYSTEM.

I even tried running a small bash script instead of the
/usr/bin/postmaster,
 echoing some string into a file in /tmp - it would create the file
when started as service under SYSTEM, but would not do anything when
started as service under postgres.

I suspect a problem with path, but the system Path variable lists the
c:\cygwin\bin;c:\cygwin\usr\bin paths. Then I guess CYGIPC would be
having problems - but it runs OK as a service under postgres.

Furthermore, I wonder if the cygrunsrv is really intended not to put
any logs of its activity - that would help greatly.

I would really appreciate any hints. Thank you.

Pavel Hofman.



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

inSITE, s.r.o.

Rubesova 29, 301 53 Plzen
Tel., fax: +420 - 19 - 74 493 58
GSM: +420 - 603 - 163 973
Email: pavel.hofman@insite.cz
www.insite.cz


pgsql-cygwin by date:

Previous
From: Gerhard Häring
Date:
Subject: Re: Native win32 Libpq
Next
From: "Raveendra Yerraguntla"
Date:
Subject: Re: POSTGRESQL - Question