pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
register a service in Windows
4+ messages / 2 participants
[nested] [flat]

* register a service in Windows
@ 2010-04-19 15:44 Josi Perez (3T Systems) <josiperez3t@gmail.com>
  2010-04-22 18:11 ` Re: register a service in Windows Josi Perez (3T Systems) <josiperez3t@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Josi Perez (3T Systems) @ 2010-04-19 15:44 UTC (permalink / raw)
  To: pgsql-admin

Hi,

I'm trying to start automatically 3 postgresql services in Windows without
success.

What I already do:
1) Install postgres8.4.2 binaries for Windows - ok, this service installs
automatically without any action mine;

2) Created 2 new clusters:
C:\Program Files\PostgreSQL\8.4>bin\initdb --pgdata "C:\data5"  --encoding
'UTF8' --locale 'pt_BR.UTF-8' --username postgres
C:\Program Files\PostgreSQL\8.4>bin\initdb --pgdata "C:\data7"  --encoding
'UTF8' --locale 'pt_BR.UTF-8' --username postgres

and changed the postgres.conf contained in each of these directories:
in C:\data5:  port=5430
in C:\data7:  port=5434

3) Started pg_ctl manually and worked with the clusters/databases inside
pgAdminIII, including port 5432:
C:\data5>"C:\Program Files\PostgreSQL\8.4\bin\pg_ctl"  -D "C:\data5" -N
postgres842w5430  -l logfile5430  start
C:\data7>"C:\Program Files\PostgreSQL\8.4\bin\pg_ctl"  -D "C:\data7" -N
postgres842w5434  -l logfile5434  start

But, I want to start each cluster automatically.
1) If I try to register
C:\data5>"C:\Program Files\PostgreSQL\8.4\bin\pg_ctl" register -N
"postgres842w5430" -D "C:\data5" -U postgres -P postgres

comes the message:
can not open the service manager

2) In regedit I can see:
HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-8.4
HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Services\pgsql-8.4

but, how can I add a new service?
In Installations there is a key "Data Directory" - then, to start another
cluster I needed to install binary PostgreSQL again with new parameters?

3) I tried to left these commands at autoexec.nt without success.
4) I tried to use batchrun to add these commands at startup and worked, but
I needed an icon to stop the processes.

Help.
How can I start these 3 data base areas as a service in Windows?

Thanks in advance.
Josi Perez

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: register a service in Windows
  2010-04-19 15:44 register a service in Windows Josi Perez (3T Systems) <josiperez3t@gmail.com>
@ 2010-04-22 18:11 ` Josi Perez (3T Systems) <josiperez3t@gmail.com>
  2010-04-22 19:30   ` Re: register a service in Windows BlackSkaven <BlackSkaven@gmx.de>
  0 siblings, 1 reply; 4+ messages in thread

From: Josi Perez (3T Systems) @ 2010-04-22 18:11 UTC (permalink / raw)
  To: pgsql-admin

I tried to use SC Windows command (Service Commander) with an administrative
login, but no success again:
net user *postgres* mypass /add

*sc* *create* pgsql-8.4 binpath= "C:\*postgres*\8.4\bin\pg_ctl.exe
runservice -w -N pgsql-8.4 -D C:\data5\" type=own start=auto displayname= "*
PostgreSQL* 8.4 p5430" password= mypass

*sc* start pgsql-8.4

All commands above give me "Access denied".

Anyone have a tip? Am I in a wrong list to ask about this?
Thanks in advance,
Josi Perez



2010/4/19 Josi Perez (3T Systems) <josiperez3t@gmail.com>

> Hi,
>
> I'm trying to start automatically 3 postgresql services in Windows without
> success.
>
> What I already do:
> 1) Install postgres8.4.2 binaries for Windows - ok, this service installs
> automatically without any action mine;
>
> 2) Created 2 new clusters:
> C:\Program Files\PostgreSQL\8.4>bin\initdb --pgdata "C:\data5"  --encoding
> 'UTF8' --locale 'pt_BR.UTF-8' --username postgres
> C:\Program Files\PostgreSQL\8.4>bin\initdb --pgdata "C:\data7"  --encoding
> 'UTF8' --locale 'pt_BR.UTF-8' --username postgres
>
> and changed the postgres.conf contained in each of these directories:
> in C:\data5:  port=5430
> in C:\data7:  port=5434
>
> 3) Started pg_ctl manually and worked with the clusters/databases inside
> pgAdminIII, including port 5432:
> C:\data5>"C:\Program Files\PostgreSQL\8.4\bin\pg_ctl"  -D "C:\data5" -N
> postgres842w5430  -l logfile5430  start
> C:\data7>"C:\Program Files\PostgreSQL\8.4\bin\pg_ctl"  -D "C:\data7" -N
> postgres842w5434  -l logfile5434  start
>
> But, I want to start each cluster automatically.
> 1) If I try to register
> C:\data5>"C:\Program Files\PostgreSQL\8.4\bin\pg_ctl" register -N
> "postgres842w5430" -D "C:\data5" -U postgres -P postgres
>
> comes the message:
> can not open the service manager
>
> 2) In regedit I can see:
> HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-8.4
> HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Services\pgsql-8.4
>
> but, how can I add a new service?
> In Installations there is a key "Data Directory" - then, to start another
> cluster I needed to install binary PostgreSQL again with new parameters?
>
> 3) I tried to left these commands at autoexec.nt without success.
> 4) I tried to use batchrun to add these commands at startup and worked, but
> I needed an icon to stop the processes.
>
> Help.
> How can I start these 3 data base areas as a service in Windows?
>
> Thanks in advance.
> Josi Perez
>

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: register a service in Windows
  2010-04-19 15:44 register a service in Windows Josi Perez (3T Systems) <josiperez3t@gmail.com>
  2010-04-22 18:11 ` Re: register a service in Windows Josi Perez (3T Systems) <josiperez3t@gmail.com>
@ 2010-04-22 19:30   ` BlackSkaven <BlackSkaven@gmx.de>
  2010-04-29 20:19     ` Re: register a service in Windows Josi Perez (3T Systems) <josiperez3t@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: BlackSkaven @ 2010-04-22 19:30 UTC (permalink / raw)
  To: Josi Perez (3T Systems) <josiperez3t@gmail.com>; +Cc: pgsql-admin

Hello,

just use pg_ctl register ;)

http://www.postgresql.org/docs/8.4/interactive/app-pg-ctl.html

Good luck,

Peter

Am 22.04.2010 20:11, schrieb Josi Perez (3T Systems):
> I tried to use SC Windows command (Service Commander) with an
> administrative login, but no success again:
> net user *postgres* mypass /add
> 
> *sc* *create* pgsql-8.4 binpath= "C:\*postgres*\8.4\bin\pg_ctl.exe
> runservice -w -N pgsql-8.4 -D C:\data5\" type=own start=auto
> displayname= "*PostgreSQL* 8.4 p5430" password= mypass
> 
> *sc* start pgsql-8.4
> 
> All commands above give me "Access denied".
> 
> Anyone have a tip? Am I in a wrong list to ask about this?
> Thanks in advance,
> Josi Perez
> 
> 
> 
> 2010/4/19 Josi Perez (3T Systems) <josiperez3t@gmail.com
> <mailto:josiperez3t@gmail.com>>
> 
>     Hi,
> 
>     I'm trying to start automatically 3 postgresql services in Windows
>     without success.
> 
>     What I already do:
>     1) Install postgres8.4.2 binaries for Windows - ok, this service
>     installs automatically without any action mine;
> 
>     2) Created 2 new clusters:
>     C:\Program Files\PostgreSQL\8.4>bin\initdb --pgdata "C:\data5" 
>     --encoding 'UTF8' --locale 'pt_BR.UTF-8' --username postgres
>     C:\Program Files\PostgreSQL\8.4>bin\initdb --pgdata "C:\data7" 
>     --encoding 'UTF8' --locale 'pt_BR.UTF-8' --username postgres
> 
>     and changed the postgres.conf contained in each of these directories:
>     in C:\data5:  port=5430
>     in C:\data7:  port=5434
> 
>     3) Started pg_ctl manually and worked with the clusters/databases
>     inside pgAdminIII, including port 5432:
>     C:\data5>"C:\Program Files\PostgreSQL\8.4\bin\pg_ctl"  -D "C:\data5"
>     -N postgres842w5430  -l logfile5430  start
>     C:\data7>"C:\Program Files\PostgreSQL\8.4\bin\pg_ctl"  -D "C:\data7"
>     -N postgres842w5434  -l logfile5434  start
> 
>     But, I want to start each cluster automatically.
>     1) If I try to register
>     C:\data5>"C:\Program Files\PostgreSQL\8.4\bin\pg_ctl" register -N
>     "postgres842w5430" -D "C:\data5" -U postgres -P postgres
> 
>     comes the message:
>     can not open the service manager
> 
>     2) In regedit I can see:
>     HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-8.4
>     HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Services\pgsql-8.4
> 
>     but, how can I add a new service?
>     In Installations there is a key "Data Directory" - then, to start
>     another cluster I needed to install binary PostgreSQL again with new
>     parameters?
> 
>     3) I tried to left these commands at autoexec.nt without success.
>     4) I tried to use batchrun to add these commands at startup and
>     worked, but I needed an icon to stop the processes.
> 
>     Help.
>     How can I start these 3 data base areas as a service in Windows?
> 
>     Thanks in advance.
>     Josi Perez
> 
> 



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: register a service in Windows
  2010-04-19 15:44 register a service in Windows Josi Perez (3T Systems) <josiperez3t@gmail.com>
  2010-04-22 18:11 ` Re: register a service in Windows Josi Perez (3T Systems) <josiperez3t@gmail.com>
  2010-04-22 19:30   ` Re: register a service in Windows BlackSkaven <BlackSkaven@gmx.de>
@ 2010-04-29 20:19     ` Josi Perez (3T Systems) <josiperez3t@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Josi Perez (3T Systems) @ 2010-04-29 20:19 UTC (permalink / raw)
  To: pgsql-admin

Peter, thank you for your efforts in try to help me and sorry for send the
message directly to you, not for the list.
No success yet - I'm starting (and stoping) manually the 2 extra services.

About the locale, I removed this option at initdb - I will try to solve this
after the service is running.
If I use pg_ctl runservice, I got the message:
1063 ERROR_FAILED_SERVICE_CONTROLLER_CONNECT The service process could not
connect to the service controller.

If I use pg_ctl register, I continue to receive the same error - no matter
what I do:
can not open the service manager

I made a Google search and looks like no one have problems with pg_ctl
register.
Probably I am doing a stupid thing, but I can not see what.
Sugestions?

Thank you in advance,
Josi Perez



2010/4/24 BlackSkaven <BlackSkaven@gmx.de>

> Hello Josi,
>
> Well - I happen to have Windows 7 on my personal PC.
>
> -switched off UAC via tools in msconfig and restarted Windows.
> -started Windows service 'Secondary Logon' and set it to automatic
> -initialized a new cluster  (BTW: the locale you specified does'nt
> exists on Windows. Windows uses codepages instead.)
> -registered it:
> pg_ctl register -N "postgresql-8.4_2nd" -U postgres -P "password" -D
> "C:\data5" -w
>
> I just used the basic options. Check the docs for the options that fit
> your needs.
>
> Ready ;)
>
> Good luck,
>
> Peter
>

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2010-04-29 20:19 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-04-19 15:44 register a service in Windows Josi Perez (3T Systems) <josiperez3t@gmail.com>
2010-04-22 18:11 ` Josi Perez (3T Systems) <josiperez3t@gmail.com>
2010-04-22 19:30   ` BlackSkaven <BlackSkaven@gmx.de>
2010-04-29 20:19     ` Josi Perez (3T Systems) <josiperez3t@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox