Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 8CA80632C82 for ; Thu, 22 Apr 2010 15:12:03 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 44751-01 for ; Thu, 22 Apr 2010 18:11:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pz0-f179.google.com (mail-pz0-f179.google.com [209.85.222.179]) by mail.postgresql.org (Postfix) with ESMTP id 6AA8F6341CF for ; Thu, 22 Apr 2010 15:11:52 -0300 (ADT) Received: by pzk9 with SMTP id 9so1967958pzk.19 for ; Thu, 22 Apr 2010 11:11:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type; bh=3jK30KcyJ5+9uaQqQ99esBtCeusToa44SxX7ruKHY3g=; b=lLTgw8qhKsnWMRxlzHwVS8OvZ/zcpMRuFtTyY7ymGQZCVmfFZDZmCFDXcGuOf9C1x2 y+FaiITF6SQ6lWrOldxpuWdx+X8tB/plYzEldWQY6He205tlvz+elYG4Z0P9aLLzS0od Y9zApHi0UQ7qdGksCA7ejdufGFj34gIzqc7hs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=W/5AW4Qz9JxLc+rP3XvXk/QM9d9cKdgKI/Y1cfMsomjLIMHOr158+KfURk1bcMp0rh 6GFN8syj/IjFvfQQIUl/ziRlOpakNg+buWidewzT5CjaSz3wlVtmRsJaNaxsNDRrppVH sbBMGqDRXghspMHN0QWAPN8ENUA09zwBShgVE= MIME-Version: 1.0 Received: by 10.231.146.14 with HTTP; Thu, 22 Apr 2010 11:11:50 -0700 (PDT) In-Reply-To: References: Date: Thu, 22 Apr 2010 15:11:50 -0300 Received: by 10.114.215.12 with SMTP id n12mr9782632wag.68.1271959910945; Thu, 22 Apr 2010 11:11:50 -0700 (PDT) Message-ID: Subject: Re: register a service in Windows From: "Josi Perez (3T Systems)" To: pgsql-admin@postgresql.org Content-Type: multipart/alternative; boundary=0016e64b96daa9157c0484d73e42 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201004/309 X-Sequence-Number: 34403 --0016e64b96daa9157c0484d73e42 Content-Type: text/plain; charset=ISO-8859-1 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) > 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 > --0016e64b96daa9157c0484d73e42 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I tried to use SC Windows = command (Service Commander) with an administrative login, but no success ag= ain:
net user postgres mypass /add

sc create pgsql-8.4 binpath=3D "C:\postgres\8.4\bin\= pg_ctl.exe =20
runservice -w -N pgsql-8.4 -D C:\data5\" type=3Down start=3Dauto displayname=3D "Postgr= eSQL 8.4 p5430" password=3D mypass

<= span style=3D"font-family: verdana,sans-serif;">sc start pgsql-8.4

All commands above give me "Access denied&= quot;.

Anyone have a tip? Am I in= a wrong list to ask about this?
Thanks in advan= ce,
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) Insta= ll postgres8.4.2 binaries for Windows - ok, this service installs automatic= ally without any action mine;

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

and changed the postgres.conf contained in each of the= se directories:
in C:\data5:=A0 port=3D5430
in C:\data7:=A0 port=3D543= 4

3) Started pg_ctl manually and worked with the clusters/databases inside p= gAdminIII, including port 5432:
C:\data5>"C:\Progr= am=20 Files\PostgreSQL\8.4\bin\pg_ctl"=A0 -D "C:\data5" -N postgre= s842w5430=A0=20 -l logfile5430=A0 start
C:\data7>"C:\Program=20 Files\PostgreSQL\8.4\bin\pg_ctl"=A0 -D "C:\data7" -N postgre= s842w5434=A0=20 -l logfile5434=A0 start


But, I want to start each cluster aut= omatically.
1) If I try to register
C:\data5>"C:\Program File= s\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 reg= edit I can see:
HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\pos= tgresql-8.4
HKEY_LOCAL_MACHIN= E\SOFTWARE\PostgreSQL\Services\pgsql-8.4

but, how can I add a new service?
In Installations there is a key &q= uot;Data Directory" - then, to start another cluster I needed to insta= ll 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 thes= e 3 data base areas as a service in Windows?

Thanks in advance.
Josi Perez

--0016e64b96daa9157c0484d73e42--