Обсуждение: Cygwin postmaster.pid solution?

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

Cygwin postmaster.pid solution?

От
Jon V
Дата:
OK, I know this has been asked before. I've been reading archives from
various lists going back to 2001 dealing with this problem.
Unfortunately, I'm having trouble finding anything I know how to
actually apply as a solution.

PostgreSQL 7.3 running under cygwin on either an NT4.0 or Win2K machine.
If the system shuts down abnormally, the file postmaster.pid is left in
the $PGDATA directory. When the system boots back up, PostgreSQL fails
to start because of that file.

What do I do?  Reading through archives, it seems as though various
solutions have been proposed. I can think of a couple easy solutions for
a unix box, and if I was running unix I wouldn't be writing this... but
unfortunately we aren't to that stage yet.

I don't know how to set up a boot script that runs before the services
start loading... except possibly to set up another service that is a
script run under a servany type program, set up so that the postmaster
service is dependent upon it. When postmaster loads the first time, this
other service would load first and clear out the pid and go into a long
sleep. I don't like that solution, but I'm about to try it...

Any suggestions greatly appreciated!

Thanks,
  Jon


Re: Cygwin postmaster.pid solution?

От
"paul butler"
Дата:
Date sent:          Tue, 04 Feb 2003 08:55:05 -0800
From:               Jon V <jon@cecorp.com>
To:                 pgsql-novice@postgresql.org
Subject:            [NOVICE] Cygwin postmaster.pid solution?

Just delete the .pid file in windows or rm it in cygwin,
bob's your uncle
HTH

Paul Butler

> OK, I know this has been asked before. I've been reading archives from
> various lists going back to 2001 dealing with this problem.
> Unfortunately, I'm having trouble finding anything I know how to
> actually apply as a solution.
>
> PostgreSQL 7.3 running under cygwin on either an NT4.0 or Win2K machine.
> If the system shuts down abnormally, the file postmaster.pid is left in
> the $PGDATA directory. When the system boots back up, PostgreSQL fails
> to start because of that file.
>
> What do I do?  Reading through archives, it seems as though various
> solutions have been proposed. I can think of a couple easy solutions for
> a unix box, and if I was running unix I wouldn't be writing this... but
> unfortunately we aren't to that stage yet.
>
> I don't know how to set up a boot script that runs before the services
> start loading... except possibly to set up another service that is a
> script run under a servany type program, set up so that the postmaster
> service is dependent upon it. When postmaster loads the first time, this
> other service would load first and clear out the pid and go into a long
> sleep. I don't like that solution, but I'm about to try it...
>
> Any suggestions greatly appreciated!
>
> Thanks,
>   Jon
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html



Re: Cygwin postmaster.pid solution?

От
Jon V
Дата:
paul butler wrote:

>Just delete the .pid file in windows or rm it in cygwin,
>bob's your uncle
>HTH
>
>
Well, yes, but... how do I do that automatically at boot?

The servers don't really have on-site administrators, and it would be a
real nightmare if any time one rebooted for whatever reason we had to
dial in to it just to delete one PIDling little file. :)



>Paul Butler
>
>
>
>>OK, I know this has been asked before. I've been reading archives from
>>various lists going back to 2001 dealing with this problem.
>>Unfortunately, I'm having trouble finding anything I know how to
>>actually apply as a solution.
>>
>>PostgreSQL 7.3 running under cygwin on either an NT4.0 or Win2K machine.
>>If the system shuts down abnormally, the file postmaster.pid is left in
>>the $PGDATA directory. When the system boots back up, PostgreSQL fails
>>to start because of that file.
>>
>>What do I do?  Reading through archives, it seems as though various
>>solutions have been proposed. I can think of a couple easy solutions for
>>a unix box, and if I was running unix I wouldn't be writing this... but
>>unfortunately we aren't to that stage yet.
>>
>>I don't know how to set up a boot script that runs before the services
>>start loading... except possibly to set up another service that is a
>>script run under a servany type program, set up so that the postmaster
>>service is dependent upon it. When postmaster loads the first time, this
>>other service would load first and clear out the pid and go into a long
>>sleep. I don't like that solution, but I'm about to try it...
>>
>>Any suggestions greatly appreciated!
>>
>>Thanks,
>>  Jon
>>
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 5: Have you checked our extensive FAQ?
>>
>>http://www.postgresql.org/users-lounge/docs/faq.html
>>
>>
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?
>
>http://www.postgresql.org/users-lounge/docs/faq.html
>
>
>
>



Re: Cygwin postmaster.pid solution?

От
"paul butler"
Дата:
Date sent:          Tue, 04 Feb 2003 09:23:40 -0800
From:               Jon V <jon@cecorp.com>
To:                 paul@entropia.co.uk
Copies to:          pgsql-novice@postgresql.org
Subject:            Re: [NOVICE] Cygwin postmaster.pid solution?

I'm afraid I don't know about windows start up scripts,
a .bat or .vbs file in the startup folder maybe but I've no idea if
services are run before the starup folder is accessed, sorry I
misunderstood you
maybe these can help

http://www.winscriptingsolutions.com
www.windowsshellscripting.com

> paul butler wrote:
>
> >Just delete the .pid file in windows or rm it in cygwin,
> >bob's your uncle
> >HTH
> >
> >
> Well, yes, but... how do I do that automatically at boot?
>
> The servers don't really have on-site administrators, and it would be a
> real nightmare if any time one rebooted for whatever reason we had to
> dial in to it just to delete one PIDling little file. :)
>
>
>
> >Paul Butler
> >
> >
> >
> >>OK, I know this has been asked before. I've been reading archives from
> >>various lists going back to 2001 dealing with this problem.
> >>Unfortunately, I'm having trouble finding anything I know how to
> >>actually apply as a solution.
> >>
> >>PostgreSQL 7.3 running under cygwin on either an NT4.0 or Win2K machine.
> >>If the system shuts down abnormally, the file postmaster.pid is left in
> >>the $PGDATA directory. When the system boots back up, PostgreSQL fails
> >>to start because of that file.
> >>
> >>What do I do?  Reading through archives, it seems as though various
> >>solutions have been proposed. I can think of a couple easy solutions for
> >>a unix box, and if I was running unix I wouldn't be writing this... but
> >>unfortunately we aren't to that stage yet.
> >>
> >>I don't know how to set up a boot script that runs before the services
> >>start loading... except possibly to set up another service that is a
> >>script run under a servany type program, set up so that the postmaster
> >>service is dependent upon it. When postmaster loads the first time, this
> >>other service would load first and clear out the pid and go into a long
> >>sleep. I don't like that solution, but I'm about to try it...
> >>
> >>Any suggestions greatly appreciated!
> >>
> >>Thanks,
> >>  Jon
> >>
> >>
> >>---------------------------(end of broadcast)---------------------------
> >>TIP 5: Have you checked our extensive FAQ?
> >>
> >>http://www.postgresql.org/users-lounge/docs/faq.html
> >>
> >>
> >
> >
> >
> >---------------------------(end of broadcast)---------------------------
> >TIP 5: Have you checked our extensive FAQ?
> >
> >http://www.postgresql.org/users-lounge/docs/faq.html
> >
> >
> >
> >
>
>



Re: Cygwin postmaster.pid solution?

От
Jon V
Дата:
paul butler wrote:

>I'm afraid I don't know about windows start up scripts,
>a .bat or .vbs file in the startup folder maybe but I've no idea if
>services are run before the starup folder is accessed,
>

Sigh... that is the problem. It seems that few know about windows start
up scripts. I don't. Services load before the startup folder (and in NT
the startup folder isn't run until a user logs in), but... there must be
some script that is run first. Well, must is a bit strong, but....

>sorry I misunderstood you
>

Don't be silly! Any help is good help, and I appreciated it even if it
wasn't exactly what I needed.

I'll check out the sites you sent. Thanks!