Обсуждение: Trouble with Cygrunsrv

Поиск
Список
Период
Сортировка

Trouble with Cygrunsrv

От
"George Weaver"
Дата:
Hi,
 
I am trying to install the Postmaster as a service using Cygrunsrv on an XP system.
 
I am used:
 
cygrunsrv --install postmaster --path /bin/postmaster --args "-l log -o -i" --dep ipc-daemon --termsig INT --shutdown
 
which installed the service.
 
When I try and start the service, it shows the service starting but then it stops and I get the following message:
 
    "The postmaster service on Local Computer started and then stopped."
 
Can someone tell me what I've missed?
 
When I view the Properties of the "postmaster" service in the Windows Control Panel link to Services, it shows the "Path to Executable" as "c:\cygwin\bin\cygrunsrv.exe".   Should this be?
 
TIA
 
George Weaver
 
 

Re: Trouble with Cygrunsrv

От
"Wim Kerkhoff"
Дата:
 
cygrunsrv --install postmaster --path /bin/postmaster --args "-l log -o -i" --dep ipc-daemon --termsig INT --shutdown
 
which installed the service.
 
When I try and start the service, it shows the service starting but then it stops and I get the following message:
 
    "The postmaster service on Local Computer started and then stopped."
 
Can someone tell me what I've missed?
 
The first thing I do when the PostgreSQL server fails to start, is check the Windows Event Log. Typically it'll show the real reason that the server failed to start. Also, make sure that the cygipc package is installed and that the Cygwin IPC Service is starting. Another problem I've seen is stale .pid files in the PostgreSQL data directory.
 
Hope that helps...

Wim
 
 
 

Re: Trouble with Cygrunsrv

От
"George Weaver"
Дата:
Thanks Wim,
 
I can start the postmaster using pg_ctl without problem, so it is working without a problem.
 
My problem is trying to get it set up as a service to start automatically when I boot my system.
 
George
----- Original Message -----
Sent: Thursday, January 09, 2003 11:02 AM
Subject: RE: [CYGWIN] Trouble with Cygrunsrv

 
cygrunsrv --install postmaster --path /bin/postmaster --args "-l log -o -i" --dep ipc-daemon --termsig INT --shutdown
 
which installed the service.
 
When I try and start the service, it shows the service starting but then it stops and I get the following message:
 
    "The postmaster service on Local Computer started and then stopped."
 
Can someone tell me what I've missed?
 
The first thing I do when the PostgreSQL server fails to start, is check the Windows Event Log. Typically it'll show the real reason that the server failed to start. Also, make sure that the cygipc package is installed and that the Cygwin IPC Service is starting. Another problem I've seen is stale .pid files in the PostgreSQL data directory.
 
Hope that helps...

Wim
 
 
 

Re: Trouble with Cygrunsrv

От
Jess Regal
Дата:
--- George Weaver <georgew1@mts.net> wrote:
> I can start the postmaster using pg_ctl without
> problem, so it is working without a problem.
>
> My problem is trying to get it set up as a service
> to start automatically when I boot my system.
>
>
>>   The first thing I do when the PostgreSQL server
>> fails to start, is check the Windows Event Log.
>> Typically it'll show the real reason that the
server
>> failed to start.
>

As Wim said, the event log will probably contain
valuable clues as to why the service is not starting.

-Jess


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

Re: Trouble with Cygrunsrv

От
"George Weaver"
Дата:
Hi Jess,
 
This is what the Event Log is showing:
 
The description for Event ID (0) in Source (postmaster) cannot be found.  The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE=flag to retrieve this description; see Help and Support for details.  The following information is part of the event: postmaster :Win32 Process Id = 0xA9C : Cygwin Process Id = 0xA9C : starting service ' postmaster' failed: execv: 1, Operation not permitted.
 
George
 
----- Original Message -----
From: "Jess Regal" <jess_regal@yahoo.com>
Sent: Thursday, January 09, 2003 11:48 AM
Subject: Re: [CYGWIN] Trouble with Cygrunsrv

>
> --- George Weaver <
georgew1@mts.net> wrote:
> > I can start the postmaster using pg_ctl without
> > problem, so it is working without a problem.
> >
> > My problem is trying to get it set up as a service
> > to start automatically when I boot my system.
> >
> >
> >>   The first thing I do when the PostgreSQL server
> >> fails to start, is check the Windows Event Log.
> >> Typically it'll show the real reason that the
> server
> >> failed to start.
> >
>
> As Wim said, the event log will probably contain
> valuable clues as to why the service is not starting.
>
> -Jess
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
>
http://mailplus.yahoo.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to
majordomo@postgresql.org
>

Re: Trouble with Cygrunsrv

От
Jason Tishler
Дата:
George,

On Thu, Jan 09, 2003 at 10:35:06AM -0600, George Weaver wrote:
> I am trying to install the Postmaster as a service using Cygrunsrv on
> an XP system.

XP Home or Pro?

> Can someone tell me what I've missed?

See my next post for a possibility.

> When I view the Properties of the "postmaster" service in the Windows
> Control Panel link to Services, it shows the "Path to Executable" as
> "c:\cygwin\bin\ cygrunsrv.exe".   Should this be?

Yes.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: Trouble with Cygrunsrv

От
Jason Tishler
Дата:
George,

On Thu, Jan 09, 2003 at 02:21:36PM -0600, George Weaver wrote:
> This is what the Event Log is showing:
>
> [snip]
> The following information is part of the event: postmaster :Win32
> Process Id = 0xA9C : Cygwin Process Id = 0xA9C : starting service '
> postmaster' failed: execv: 1, Operation not permitted.

Does the following apply?

    On Wed, Nov 20, 2002 at 02:13:49PM -0800, Jess Regal wrote:
    > Looks like a file permissions error.  Make sure that whatever user
    > the postmaster service is running under has read/write(/modify?)
    > permissions on the file, "/var/log/postmaster.log".

It should, if you are also getting the following in the Event Log too:

[36192] postmaster
   Type:     ERROR
   Computer: TISHLERJASON
   Time:     1/10/2003 10:31:06 AM   ID:       0
   User:     postgres\TISHLERJASON
postmaster : Win32 Process Id = 0x378 : Cygwin Process Id = 0x378 : starting service `' failed: redirect_fd: open (1,
/var/log/postmaster.log):13, Permission denied 

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: Trouble with Cygrunsrv

От
"George Weaver"
Дата:
Hi Jason,

XP Home.

Is the next post you referred to the one referring to PostgreSQL 7.3.1.1?

Thanks,
George

----- Original Message -----
From: "Jason Tishler" <jason@tishler.net>
To: "George Weaver" <georgew1@mts.net>
Cc: <pgsql-cygwin@postgresql.org>
Sent: Friday, January 10, 2003 9:42 AM
Subject: Re: [CYGWIN] Trouble with Cygrunsrv


> George,
>
> On Thu, Jan 09, 2003 at 10:35:06AM -0600, George Weaver wrote:
> > I am trying to install the Postmaster as a service using Cygrunsrv on
> > an XP system.
>
> XP Home or Pro?
>
> > Can someone tell me what I've missed?
>
> See my next post for a possibility.
>
> > When I view the Properties of the "postmaster" service in the Windows
> > Control Panel link to Services, it shows the "Path to Executable" as
> > "c:\cygwin\bin\ cygrunsrv.exe".   Should this be?
>
> Yes.
>
> Jason
>
> --
> PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
> Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

Re: Trouble with Cygrunsrv

От
Jason Tishler
Дата:
George,

On Fri, Jan 10, 2003 at 11:25:24AM -0600, George Weaver wrote:
> XP Home.

Argh!  XP Home has caused at least some people on the list to have
problems running PostgreSQL as a service.  I don't have access to XP
Home.  So I, can't really help if it is different than NT/2000 in this
regard.

> Is the next post you referred to the one referring to PostgreSQL 7.3.1.1?

Sorry, for being ambiguous.  I meant the attached.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6
George,

On Thu, Jan 09, 2003 at 02:21:36PM -0600, George Weaver wrote:
> This is what the Event Log is showing:
>
> [snip]
> The following information is part of the event: postmaster :Win32
> Process Id = 0xA9C : Cygwin Process Id = 0xA9C : starting service '
> postmaster' failed: execv: 1, Operation not permitted.

Does the following apply?

    On Wed, Nov 20, 2002 at 02:13:49PM -0800, Jess Regal wrote:
    > Looks like a file permissions error.  Make sure that whatever user
    > the postmaster service is running under has read/write(/modify?)
    > permissions on the file, "/var/log/postmaster.log".

It should, if you are also getting the following in the Event Log too:

[36192] postmaster
   Type:     ERROR
   Computer: TISHLERJASON
   Time:     1/10/2003 10:31:06 AM   ID:       0
   User:     postgres\TISHLERJASON
postmaster : Win32 Process Id = 0x378 : Cygwin Process Id = 0x378 : starting service `' failed: redirect_fd: open (1,
/var/log/postmaster.log):13, Permission denied 

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: Trouble with Cygrunsrv

От
"George Weaver"
Дата:
Hi Jason,

Thanks for you ideas - you did provide a tip (see below) which is helping
zero in on the problem.

I think I'm making progress, although I have not solved the problem yet.

The PostgreSQL database that I have been using (starting up postmaster with
pg_ctl) is located in "C:\cygwin\bin\data".  Everything works perfectly when
I start postmaster with pg_ctl.  I have the environment variable PGDATA set
to "data".

I have run cygrunsrv configured as follows:

"cygrunsrv --install postmaster --path /bin/postmaster --a "'-D
/bin/data' -i" --dep ipc-daemon --termsig INT --shutdown"

Cygrunsrv configured as above installs the service.  When I try to start the
service I get:

"C:\cygwin\bin>net start postmaster
The postmaster service is starting.
The postmaster service could not be started."

In \var\log\postmaster.log  (Thanks for the TIP!!) I find:

"FATAL 1:  File  /bin/data/PG_VERSION is missing. This is not a valid data
directory."

Thus it appears that Postmaster is trying to start but for some reason is
troubled by the location of the database.

I have tried every "-D" configuration I can think of without success.
PG_Version is in c:\cygwin\bin\data\ and I have not trouble starting with
pg_ctl.

Any thoughts?  Anyone?

I really appreciate the help.

George



----- Original Message -----
From: "Jason Tishler" <jason@tishler.net>
To: "George Weaver" <georgew1@mts.net>
Cc: <pgsql-cygwin@postgresql.org>
Sent: Friday, January 10, 2003 3:28 PM
Subject: Re: [CYGWIN] Trouble with Cygrunsrv


> George,
>
> On Fri, Jan 10, 2003 at 11:25:24AM -0600, George Weaver wrote:
> > XP Home.
>
> Argh!  XP Home has caused at least some people on the list to have
> problems running PostgreSQL as a service.  I don't have access to XP
> Home.  So I, can't really help if it is different than NT/2000 in this
> regard.
>
> > Is the next post you referred to the one referring to PostgreSQL
7.3.1.1?
>
> Sorry, for being ambiguous.  I meant the attached.
>
> Jason
>
> --
> PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
> Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6
>


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


>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>


Re: Trouble with Cygrunsrv

От
Jason Tishler
Дата:
George,

On Fri, Jan 10, 2003 at 04:00:32PM -0600, George Weaver wrote:
> Thanks for you ideas - you did provide a tip (see below) which is
> helping zero in on the problem.

You are welcome.

> The PostgreSQL database that I have been using (starting up postmaster
> with pg_ctl) is located in "C:\cygwin\bin\data".  Everything works
> perfectly when I start postmaster with pg_ctl.  I have the environment
> variable PGDATA set to "data".

BTW, /bin/data is a strange place for the PostgreSQL data directory.

> I have run cygrunsrv configured as follows:
>
> "cygrunsrv --install postmaster --path /bin/postmaster --a "'-D /bin/data' -i" --dep ipc-daemon --termsig INT
--shutdown"

The above runs postmaster under the LocalSystem account which is *not*
recommended.  You should use the cygrunsrv "--user" option to specify a
different user (e.g., postgres).

> Cygrunsrv configured as above installs the service.  When I try to
> start the service I get:
>
> "C:\cygwin\bin>net start postmaster
> The postmaster service is starting.
> The postmaster service could not be started."
>
> In \var\log\postmaster.log  (Thanks for the TIP!!) I find:
>
> "FATAL 1:  File  /bin/data/PG_VERSION is missing. This is not a valid data directory."

What user ran initdb?  It *must* be the same user that owns the
postmaster process.

Of course, you may have different problems caused by XP Home...

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6