Обсуждение: Windows Dependency Issue

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

Windows Dependency Issue

От
"Peter Egan"
Дата:
Hello,
 
We have a windows-based server that uses postgres (8.1) as the db. We use a 'silent install' to install postgres as a windows service. Our server is then installed as a service with a dependency on postgres.
 
As seen in other posts, to ensure that postgres starts up before the server starts, one should use the pg_ctl command with the '-w' flag. When installed as a service, the '-w' flag isn't set.
 
My question - is there a way to set this '-w' flag through the silent install process? Or is there another way to accomplish this without requiring the user to set this after the installation process?
 
Any help would be appreciated.
 
Thanks,
Pete
 

Re: Windows Dependency Issue

От
"Andy Shellam (Mailing Lists)"
Дата:
Hello Pete,

There is certainly a Windows command you can run that will alter the
command used to start a service - it's "sc" (which can also be used to
start/stop a service programmatically.)
The command syntax to modify the EXE path is:

sc config <service name> binpath= "<path to EXE>"

(eg.)
sc config "PostgreSQL Database Server <version>" binpath= "C:\Program
Files\PostgreSQL\bin\<postmaster EXE and flags>"

If it's successful, you'll get the message: "[SC] ChangeServiceConfig
SUCCESS"

Also note there's a space between "binpath=" and the EXE name - that
took me a while to figure out!

Hope this can be of use.

Andy.

Peter Egan wrote:
> Hello,
>
> We have a windows-based server that uses postgres (8.1) as the db. We
> use a 'silent install' to install postgres as a windows service. Our
> server is then installed as a service with a dependency on postgres.
>
> As seen in other posts, to ensure that postgres starts up before the
> server starts, one should use the pg_ctl command with the '-w'
> flag. When installed as a service, the '-w' flag isn't set.
>
> My question - is there a way to set this '-w' flag through the silent
> install process? Or is there another way to accomplish this without
> requiring the user to set this after the installation process?
>
> Any help would be appreciated.
>
> Thanks,
> Pete
>
> !DSPAM:37,459d40d631947254553576!


--
Andy Shellam
NetServe Support Team

the Mail Network
"an alternative in a standardised world"

p: +44 (0) 121 288 0832/0839
m: +44 (0) 7818 000834