From raul@zerosoft.ro Thu Mar 18 15:11:49 2004 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 80C40D1EBB7 for ; Thu, 18 Mar 2004 15:11:49 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 80886-08 for ; Thu, 18 Mar 2004 11:11:47 -0400 (AST) Received: from mail.zerosoft.ro (main.zerosoft.ro [193.226.89.14]) by svr1.postgresql.org (Postfix) with ESMTP id CA605D1E208 for ; Thu, 18 Mar 2004 11:11:33 -0400 (AST) Received: from 192.168.16.10 by mail.zerosoft.ro ([192.168.16.1] running VPOP3) with SMTP for ; Thu, 18 Mar 2004 17:22:07 +0200 Message-ID: <001b01c40cfc$c6af5dd0$0a10a8c0@zerosoft.ro> Reply-To: "Raul Secan" From: "Raul Secan" To: Subject: running postgresql as a linux service Date: Thu, 18 Mar 2004 17:22:07 +0200 Organization: ZEROSOFT MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0018_01C40D0D.8A2F0610" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Server: VPOP3 V1.4.5 - Registered to: ZeroSoft X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=BAYES_44, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200403/44 X-Sequence-Number: 2643 This is a multi-part message in MIME format. ------=_NextPart_000_0018_01C40D0D.8A2F0610 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I have succesfuly installed PostgreSQL 7.4.1, on my OS which is Red = Hat Linux 9.0. I start the server with: $ pg_ctl -D /usr/local/pgsql/data -l logfile start=20 And stop it with: $ pg_ctl -D /usr/local/pgsql/data stop -m fast There are two questions here, which I want to put to you guys: 1. How can make PostgreSQL run as a Linux service so database server starts= at each reboot 2. How can I register the PGDATA environment variable, so I don't have to u= se -D /usr/local/pgsql/data parameter (and don't use -l logfile if it is po= sible) when run the start command Thanks, Raul Secan. ------=_NextPart_000_0018_01C40D0D.8A2F0610 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello, I have succesfuly installed Postgre= SQL=20 7.4.1, on my OS which is Red Hat Li= nux=20 9.0.
 
I start the server with:
$ pg_ctl -D /usr/local/pgsql/data -l logfi= le start=20
 
And stop it with:
$ pg_ctl -D /usr/local/pgsql/data stop -m= =20 fast
 
There are two questions here, which I want= to put=20 to you guys:
1. How can make PostgreSQL run a= s a Linux=20 service so database server starts at each reboot
2. How can I register the PGDATA environme= nt=20 variable, so I don't have to use -D /usr/local/pgsql/data parameter=20 (and don't use -l logfile if it is posible) when run the=20 start command
 
Thanks, Raul Secan.
------=_NextPart_000_0018_01C40D0D.8A2F0610-- From rstpierre@syscor.com Thu Mar 18 15:56:16 2004 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id D24E6D1DF4D for ; Thu, 18 Mar 2004 15:56:16 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 06733-03 for ; Thu, 18 Mar 2004 11:56:16 -0400 (AST) Received: from silmaril.syscor.priv (h24-108-208-253.sbm.shawcable.net [24.108.208.253]) by svr1.postgresql.org (Postfix) with ESMTP id 4A591D1D2E2 for ; Thu, 18 Mar 2004 11:56:11 -0400 (AST) Received: from syscor.com (strider.syscor.priv [192.168.1.3]) by silmaril.syscor.priv (8.12.8/8.12.8) with ESMTP id i2IFuGXR015873; Thu, 18 Mar 2004 07:56:17 -0800 Message-ID: <4059C6D5.3010201@syscor.com> Date: Thu, 18 Mar 2004 07:57:09 -0800 From: Ron St-Pierre User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Raul Secan , pgsql-php@postgresql.org Subject: Re: running postgresql as a linux service References: <001b01c40cfc$c6af5dd0$0a10a8c0@zerosoft.ro> In-Reply-To: <001b01c40cfc$c6af5dd0$0a10a8c0@zerosoft.ro> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/45 X-Sequence-Number: 2644 Raul Secan wrote: > Hello, I have succesfuly installed PostgreSQL 7.4.1, on my OS which is > Red Hat Linux 9.0. > > I start the server with: > $ pg_ctl -D /usr/local/pgsql/data -l logfile start > > And stop it with: > $ pg_ctl -D /usr/local/pgsql/data stop -m fast > > There are two questions here, which I want to put to you guys: > 1. How can make PostgreSQL run as a Linux service so database server > starts at each reboot Below are the steps I use when I manually install PostgreSQL to have it running when the server starts. However I don't use Red Hat, I use Mandrake instead. You should be able to find the corresponding files on your server if you know the installation directories for your PostgreSQL, or use utilities like 'locate' or 'find' to find out where they are installed. *as root*: - Configure the PostgreSQL SysV Script. This script is useful for starting, stopping, and checking the status of PostgreSQL. # cd /usr/local/src/postgresql-7.x # cp contrib/start-scripts/linux /etc/init.d/postgres # chmod 755 /etc/init.d/postgres .... then edit the file to specify the data directory, etc. and sets the environment variabes (PGDATA etc). The file is well documented. If you installed Postgres manually, it should have the correct values already set. - To have PostgreSQL start automatically when the computer boots add symbolic links from the correct /etc/rc*.d/ directories to /etc/init.d/postgres. If the normal runlevel is 3 then you really only need to add it to rc3.d: # ln -s /etc/init.d/postgres /etc/rc2.d/S85postgres # ln -s /etc/init.d/postgres /etc/rc3.d/S85postgres etc ... - Start PostgreSQL for the first time: # /etc/init.d/postgres start <\start> > 2. How can I register the PGDATA environment variable, so I don't have > to use -D /usr/local/pgsql/data parameter (and don't use -l logfile if > it is posible) when run the start command > If step 1. works correctly, the PGDATA variable is set properly. Otherwise edit the /etc/init.d/postgres file. > Thanks, Raul Secan. Ron From jam@zoidtechnologies.com Thu Mar 18 17:52:25 2004 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id E7646D1C9EA for ; Thu, 18 Mar 2004 17:52:25 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 44901-10 for ; Thu, 18 Mar 2004 13:52:19 -0400 (AST) Received: from toast.zoidtechnologies.com (unknown [216.144.212.170]) by svr1.postgresql.org (Postfix) with ESMTP id B0D65D1C4EB for ; Thu, 18 Mar 2004 13:52:13 -0400 (AST) Received: from eros.zoidtechnologies.com (unknown [192.168.2.7]) by toast.zoidtechnologies.com (Postfix) with ESMTP id 8227B20107; Thu, 18 Mar 2004 12:52:18 -0500 (EST) Received: by eros.zoidtechnologies.com (Postfix, from userid 500) id 66F272659BF; Thu, 18 Mar 2004 12:52:18 -0500 (EST) Date: Thu, 18 Mar 2004 12:52:18 -0500 From: Jeff MacDonald To: Raul Secan Cc: pgsql-php@postgresql.org Subject: Re: running postgresql as a linux service Message-ID: <20040318175218.GQ9163@zoidtechnologies.com> References: <001b01c40cfc$c6af5dd0$0a10a8c0@zerosoft.ro> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TSQPSNmi3T91JED+" Content-Disposition: inline In-Reply-To: <001b01c40cfc$c6af5dd0$0a10a8c0@zerosoft.ro> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/47 X-Sequence-Number: 2646 --TSQPSNmi3T91JED+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 18, 2004 at 05:22:07PM +0200, Raul Secan wrote: > Hello, I have succesfuly installed PostgreSQL 7.4.1, on my OS which is Re= d Hat Linux 9.0. >=20 > I start the server with: > $ pg_ctl -D /usr/local/pgsql/data -l logfile start=20 >=20 > And stop it with: > $ pg_ctl -D /usr/local/pgsql/data stop -m fast >=20 > There are two questions here, which I want to put to you guys: > 1. How can make PostgreSQL run as a Linux service so database server > starts at each reboot run 'ntsysv' as root, and make sure the checkbox next to "postgresql" is turned on. > 2. How can I register the PGDATA environment variable, so I don't have to > use -D /usr/local/pgsql/data parameter (and don't use -l logfile if it is > posible) when run the start command >=20 I generally use something like: # /usr/sbin/service postgresql start to start the service, and "stop" to stop it. this *should* take care of dealing with the -D option. > Thanks, Raul Secan. hope that helps. regards, J --TSQPSNmi3T91JED+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQFAWeHRJr1gbjUXKkIRAiDCAKCMLytcg+fIxwyMJlJaeiNSWPpD3gCfQZMK 3ODD0E7EZgKQ54EXWwbzqvE= =l88s -----END PGP SIGNATURE----- --TSQPSNmi3T91JED+-- From raul@zerosoft.ro Fri Mar 19 09:46:42 2004 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 8E4CBD1E14C for ; Fri, 19 Mar 2004 09:46:42 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 12333-06 for ; Fri, 19 Mar 2004 05:46:42 -0400 (AST) Received: from mail.zerosoft.ro (main.zerosoft.ro [193.226.89.14]) by svr1.postgresql.org (Postfix) with ESMTP id 61230D1BB95 for ; Fri, 19 Mar 2004 05:46:35 -0400 (AST) Received: from 192.168.16.10 by mail.zerosoft.ro ([192.168.16.1] running VPOP3) with SMTP; Fri, 19 Mar 2004 11:49:36 +0200 Message-ID: <006b01c40d97$7d6106b0$0a10a8c0@zerosoft.ro> Reply-To: "Raul Secan" From: "Raul Secan" To: "Ron St-Pierre" , References: <001b01c40cfc$c6af5dd0$0a10a8c0@zerosoft.ro> <4059C6D5.3010201@syscor.com> Subject: Re: running postgresql as a linux service Date: Fri, 19 Mar 2004 11:49:36 +0200 Organization: ZEROSOFT MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Server: VPOP3 V1.4.5 - Registered to: ZeroSoft X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/48 X-Sequence-Number: 2647 I saw that in /etc/init.d/ dir I already have postgresql, so the service is installed, bu wehn try to run: service postgresql start I receive: Initializing database: [FAILED] Starting postgresql service: pg_ctl: no operation mode specified Try "pg_ctl --help" for more information. -sh: line 2: -p: command not found Anyway I just edit the postgresql file and see something anormal there I think: export PGDATA=/var/lib/pgsql/data But my Postgresql data dir is /usr/local/pgsql/data. Can someone tell me what is going on? Thanks. ----- Original Message ----- From: "Ron St-Pierre" To: "Raul Secan" ; Sent: Thursday, March 18, 2004 5:57 PM Subject: Re: [PHP] running postgresql as a linux service Raul Secan wrote: > Hello, I have succesfuly installed PostgreSQL 7.4.1, on my OS which is > Red Hat Linux 9.0. > > I start the server with: > $ pg_ctl -D /usr/local/pgsql/data -l logfile start > > And stop it with: > $ pg_ctl -D /usr/local/pgsql/data stop -m fast > > There are two questions here, which I want to put to you guys: > 1. How can make PostgreSQL run as a Linux service so database server > starts at each reboot Below are the steps I use when I manually install PostgreSQL to have it running when the server starts. However I don't use Red Hat, I use Mandrake instead. You should be able to find the corresponding files on your server if you know the installation directories for your PostgreSQL, or use utilities like 'locate' or 'find' to find out where they are installed. *as root*: - Configure the PostgreSQL SysV Script. This script is useful for starting, stopping, and checking the status of PostgreSQL. # cd /usr/local/src/postgresql-7.x # cp contrib/start-scripts/linux /etc/init.d/postgres # chmod 755 /etc/init.d/postgres .... then edit the file to specify the data directory, etc. and sets the environment variabes (PGDATA etc). The file is well documented. If you installed Postgres manually, it should have the correct values already set. - To have PostgreSQL start automatically when the computer boots add symbolic links from the correct /etc/rc*.d/ directories to /etc/init.d/postgres. If the normal runlevel is 3 then you really only need to add it to rc3.d: # ln -s /etc/init.d/postgres /etc/rc2.d/S85postgres # ln -s /etc/init.d/postgres /etc/rc3.d/S85postgres etc ... - Start PostgreSQL for the first time: # /etc/init.d/postgres start <\start> > 2. How can I register the PGDATA environment variable, so I don't have > to use -D /usr/local/pgsql/data parameter (and don't use -l logfile if > it is posible) when run the start command > If step 1. works correctly, the PGDATA variable is set properly. Otherwise edit the /etc/init.d/postgres file. > Thanks, Raul Secan. Ron ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster From postgresql@finner.de Fri Mar 19 10:58:59 2004 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 04E68D1CC79 for ; Fri, 19 Mar 2004 10:58:59 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 42392-03 for ; Fri, 19 Mar 2004 06:58:51 -0400 (AST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.173]) by svr1.postgresql.org (Postfix) with ESMTP id A298DD1B91B for ; Fri, 19 Mar 2004 06:58:47 -0400 (AST) Received: from [212.227.126.160] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1B4HiC-0007MI-00 for pgsql-php@postgresql.org; Fri, 19 Mar 2004 11:58:48 +0100 Received: from [80.146.143.53] (helo=lorien.finner.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1B4HiB-00044N-00 for pgsql-php@postgresql.org; Fri, 19 Mar 2004 11:58:48 +0100 Received: from isengard.finner.de (isengard.finner.de [192.168.14.20]) by lorien.finner.de (Postfix on SuSE Linux 7.3 (i386)) with ESMTP id 86C5056DB8 for ; Fri, 19 Mar 2004 11:58:42 +0100 (CET) Received: by isengard.finner.de (Postfix, from userid 500) id 3CEF587FB5; Fri, 19 Mar 2004 11:58:39 +0100 (CET) Date: Fri, 19 Mar 2004 11:58:39 +0100 From: Frank Finner Cc: pgsql-php@postgresql.org Subject: Re: running postgresql as a linux service Message-Id: <20040319115839.539932e9.postgresql@finner.de> In-Reply-To: <006b01c40d97$7d6106b0$0a10a8c0@zerosoft.ro> References: <001b01c40cfc$c6af5dd0$0a10a8c0@zerosoft.ro> <4059C6D5.3010201@syscor.com> <006b01c40d97$7d6106b0$0a10a8c0@zerosoft.ro> X-Mailer: Sylpheed version 0.8.10claws72 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: base64 X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:2d1f62c261f062640f582804a7b1040c X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/49 X-Sequence-Number: 2648 T24gRnJpLCAxOSBNYXIgMjAwNCAxMTo0OTozNiArMDIwMCAiUmF1bCBTZWNh biIgPHJhdWxAemVyb3NvZnQucm8+IHNhdCBkb3duLCB0aG91Z2h0IGxvbmcg YW5kIHRoZW4NCndyb3RlOg0KDQo+IEkgc2F3IHRoYXQgaW4gL2V0Yy9pbml0 LmQvIGRpciBJIGFscmVhZHkgaGF2ZSBwb3N0Z3Jlc3FsLCBzbyB0aGUgc2Vy dmljZSBpcw0KPiBpbnN0YWxsZWQsIGJ1IHdlaG4gdHJ5IHRvIHJ1bjoNCj4g DQo+IHNlcnZpY2UgcG9zdGdyZXNxbCBzdGFydA0KPiANCj4gSSByZWNlaXZl Og0KPiANCj4gSW5pdGlhbGl6aW5nIGRhdGFiYXNlOiBbRkFJTEVEXQ0KPiBT dGFydGluZyBwb3N0Z3Jlc3FsIHNlcnZpY2U6IHBnX2N0bDogbm8gb3BlcmF0 aW9uIG1vZGUgc3BlY2lmaWVkDQo+IFRyeSAicGdfY3RsIC0taGVscCIgZm9y IG1vcmUgaW5mb3JtYXRpb24uDQo+IC1zaDogbGluZSAyOiAtcDogY29tbWFu ZCBub3QgZm91bmQNCj4gDQo+IEFueXdheSBJIGp1c3QgZWRpdCB0aGUgcG9z dGdyZXNxbCBmaWxlIGFuZCBzZWUgc29tZXRoaW5nIGFub3JtYWwgdGhlcmUg SQ0KPiB0aGluazoNCj4gDQo+IGV4cG9ydCBQR0RBVEE9L3Zhci9saWIvcGdz cWwvZGF0YQ0KPiANCj4gQnV0IG15IFBvc3RncmVzcWwgZGF0YSBkaXIgaXMg L3Vzci9sb2NhbC9wZ3NxbC9kYXRhLg0KPiANCj4gQ2FuIHNvbWVvbmUgdGVs bCBtZSB3aGF0IGlzIGdvaW5nIG9uPw0KPiBUaGFua3MuDQo+IA0KDQpPbiBT dVNFIGRpc3RyaWJ1dGlvbnMgZm9yIGV4YW1wbGUsIGlmIHlvdSB1c2UgKG9y IGV2ZXIgaW5zdGFsbGVkKSB0aGUgc2hpcHBlZCBQb3N0Z3JlU1FMIHJlbGVh c2UsDQp5b3UgZmluZCBhIHN0YXJ0c3RvcC1zY3JpcHQsIHdoaWNoIGFsc28g ZG9lcyBub3Qgd29yayB3aXRoIGEgc2VsZiBjb21waWxlZCByZWxlYXNlIChh bmQgYWxzbyB1c2VzDQovdmFyL2xpYi9wZ3NxbC9kYXRhIGFzIFBHREFUQSku IElmIGl0tHMgdGhlIHNhbWUgd2l0aCB5b3VyIGRpc3RyaWJ1dGlvbiwgc2lt cGx5IGRlbGV0ZSB0aGlzIHNjcmlwdC4NCkkgcmVjb21tZW5kIHRoZSBzdGFy dC1zY3JpcHQgeW91IGZpbmQgaW4gIi9jb250cmliL3N0YXJ0LXNjcmlwdHMv bGludXgiIGluIHRoZSBQb3N0Z3JlU1FMIHRhcmJhbGwuDQpDb3B5IGl0IHRv IC9ldGMvaW5pdC5kIGFuZCBmb2xsb3cgdGhlIGZ1cnRoZXIgaW5zdHJ1Y3Rp b25zIGluc2lkZSB0aGlzIHNjcmlwdC4gRG9utHQgZm9yZ2V0IHRvDQpjaG1v ZCBpdCBleGVjdXRhYmxlLiBGb3IgbWUgaXQgd29ya3MgdmVyeSB3ZWxsIG9u IHNldmVyYWwgc2VydmVycy4NCg0KUmVnYXJkcywgRnJhbmsuDQo= From rstpierre@syscor.com Mon Mar 22 16:34:51 2004 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C58A7D1B97B for ; Mon, 22 Mar 2004 16:34:51 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 83185-02 for ; Mon, 22 Mar 2004 12:34:54 -0400 (AST) Received: from silmaril.syscor.priv (h24-108-208-253.sbm.shawcable.net [24.108.208.253]) by svr1.postgresql.org (Postfix) with ESMTP id 3A164D1D478 for ; Mon, 22 Mar 2004 12:34:43 -0400 (AST) Received: from syscor.com (strider.syscor.priv [192.168.1.3]) by silmaril.syscor.priv (8.12.8/8.12.8) with ESMTP id i2MGYsXR029648; Mon, 22 Mar 2004 08:34:54 -0800 Message-ID: <405F15E2.4040109@syscor.com> Date: Mon, 22 Mar 2004 08:35:46 -0800 From: Ron St-Pierre User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Raul Secan , pgsql-php@postgresql.org Subject: Re: running postgresql as a linux service References: <001b01c40cfc$c6af5dd0$0a10a8c0@zerosoft.ro> <4059C6D5.3010201@syscor.com> <006b01c40d97$7d6106b0$0a10a8c0@zerosoft.ro> In-Reply-To: <006b01c40d97$7d6106b0$0a10a8c0@zerosoft.ro> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/54 X-Sequence-Number: 2653 I haven't had access to my mail over the last few days, so in case you are still having a problem, check below. Raul Secan wrote: >I saw that in /etc/init.d/ dir I already have postgresql, so the service is >installed, bu wehn try to run: > >service postgresql start > >I receive: > >Initializing database: [FAILED] >Starting postgresql service: pg_ctl: no operation mode specified >Try "pg_ctl --help" for more information. >-sh: line 2: -p: command not found > >Anyway I just edit the postgresql file and see something anormal there I >think: > >export PGDATA=/var/lib/pgsql/data > >But my Postgresql data dir is /usr/local/pgsql/data. > >Can someone tell me what is going on? >Thanks. > > This is why you have to copy over the 'postgres' file in /etc/init.d cp contrib/start-scripts/linux /etc/init.d/postgres If you have properly installed postgres then the file that you are copying over from contrib/start-scripts/ will be properly configured with the correct environment variables. I would also recommend that you delete anything in your /var/lib/pgsql/ directory if you haven't already done so (after backing up any databases you may have). >----- Original Message ----- >From: "Ron St-Pierre" >To: "Raul Secan" ; >Sent: Thursday, March 18, 2004 5:57 PM >Subject: Re: [PHP] running postgresql as a linux service > > >Raul Secan wrote: > > > >>Hello, I have succesfuly installed PostgreSQL 7.4.1, on my OS which is >>Red Hat Linux 9.0. >> >>I start the server with: >>$ pg_ctl -D /usr/local/pgsql/data -l logfile start >> >>And stop it with: >>$ pg_ctl -D /usr/local/pgsql/data stop -m fast >> >>There are two questions here, which I want to put to you guys: >>1. How can make PostgreSQL run as a Linux service so database server >>starts at each reboot >> >> > >Below are the steps I use when I manually install PostgreSQL to have it >running when the server starts. However I don't use Red Hat, I use >Mandrake instead. You should be able to find the corresponding files on >your server if you know the installation directories for your >PostgreSQL, or use utilities like 'locate' or 'find' to find out where >they are installed. > > > >*as root*: >- Configure the PostgreSQL SysV Script. This script is useful for >starting, stopping, and checking the status of PostgreSQL. > ># cd /usr/local/src/postgresql-7.x ># cp contrib/start-scripts/linux /etc/init.d/postgres ># chmod 755 /etc/init.d/postgres >.... then edit the file to specify the data directory, etc. and sets the >environment variabes (PGDATA etc). The file is well documented. If you >installed Postgres manually, it should have the correct values already set. > >- To have PostgreSQL start automatically when the computer boots add >symbolic links from the correct /etc/rc*.d/ directories to >/etc/init.d/postgres. If the normal runlevel is 3 then you really only >need to add it to rc3.d: > ># ln -s /etc/init.d/postgres /etc/rc2.d/S85postgres ># ln -s /etc/init.d/postgres /etc/rc3.d/S85postgres > >etc ... > >- Start PostgreSQL for the first time: > ># /etc/init.d/postgres start > ><\start> > > > >>2. How can I register the PGDATA environment variable, so I don't have >>to use -D /usr/local/pgsql/data parameter (and don't use -l logfile if >>it is posible) when run the start command >> >> >> > >If step 1. works correctly, the PGDATA variable is set properly. >Otherwise edit the /etc/init.d/postgres file. > > > >>Thanks, Raul Secan. >> >> > > >Ron > > > > >---------------------------(end of broadcast)--------------------------- >TIP 4: Don't 'kill -9' the postmaster > > > > From rstpierre@syscor.com Tue Mar 23 15:57:10 2004 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 23D5BD1D175 for ; Tue, 23 Mar 2004 15:57:10 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 26923-03 for ; Tue, 23 Mar 2004 11:57:12 -0400 (AST) Received: from silmaril.syscor.priv (h24-108-208-253.sbm.shawcable.net [24.108.208.253]) by svr1.postgresql.org (Postfix) with ESMTP id CDB50D1C967 for ; Tue, 23 Mar 2004 11:57:05 -0400 (AST) Received: from syscor.com (strider.syscor.priv [192.168.1.3]) by silmaril.syscor.priv (8.12.8/8.12.8) with ESMTP id i2NFvBXR032132; Tue, 23 Mar 2004 07:57:11 -0800 Message-ID: <40605E8B.10205@syscor.com> Date: Tue, 23 Mar 2004 07:58:03 -0800 From: Ron St-Pierre User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Raul Secan , pgsql-php@postgresql.org Subject: Re: running postgresql as a linux service References: <001b01c40cfc$c6af5dd0$0a10a8c0@zerosoft.ro> <4059C6D5.3010201@syscor.com> <006b01c40d97$7d6106b0$0a10a8c0@zerosoft.ro> <405F15E2.4040109@syscor.com> <000501c410c3$4d97fd10$0a10a8c0@zerosoft.ro> In-Reply-To: <000501c410c3$4d97fd10$0a10a8c0@zerosoft.ro> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/57 X-Sequence-Number: 2656 When you install postgres from the rpm or the tar or zipped tar files, you run configure, make and make install. When these are run they update certain configuration files, including the file /contrib/start-scripts/linux If you look in your current /etc/init.d/postgres file you will probably see the line: PGDATA=/var/lib/pgsql/data If you look in the file contrib/start-scripts/linux you will see that PGDATA is set correctly as: PGDATA="/usr/local/pgsql/data" That is why you have to replace/overwrite the postgres file with the linux file, using the copy command: cp contrib/start-scripts/linux /etc/init.d/postgres Even before you do that you can try to start postgres as user postgres: pg_ctl start -D /usr/local/pgsql/data The pg_ctl executable is in the /usr/local/pgsql/bin directory, but if postgres is properly installed this should be in your path. The -D argument tells postgres where your data directory is. Use pg_ctl --help for more information. Ron Raul Secan wrote: >Thanks for the TIP with the start-script, but I am still wondering why I >can't start the service with: > >service postgresql start > >Because everyting seems to be installed correctly. > >Thanks. > >----- Original Message ----- >From: "Ron St-Pierre" >To: "Raul Secan" ; >Sent: Monday, March 22, 2004 6:35 PM >Subject: Re: [PHP] running postgresql as a linux service > > >I haven't had access to my mail over the last few days, so in case you >are still having a problem, check below. > >Raul Secan wrote: > > > >>I saw that in /etc/init.d/ dir I already have postgresql, so the service is >>installed, bu wehn try to run: >> >>service postgresql start >> >>I receive: >> >>Initializing database: [FAILED] >>Starting postgresql service: pg_ctl: no operation mode specified >>Try "pg_ctl --help" for more information. >>-sh: line 2: -p: command not found >> >>Anyway I just edit the postgresql file and see something anormal there I >>think: >> >>export PGDATA=/var/lib/pgsql/data >> >>But my Postgresql data dir is /usr/local/pgsql/data. >> >>Can someone tell me what is going on? >>Thanks. >> >> >> >> >This is why you have to copy over the 'postgres' file in /etc/init.d > cp contrib/start-scripts/linux /etc/init.d/postgres >If you have properly installed postgres then the file that you are >copying over from contrib/start-scripts/ will be properly configured >with the correct environment variables. I would also recommend that you >delete anything in your /var/lib/pgsql/ directory if you haven't already >done so (after backing up any databases you may have). > > > >>----- Original Message ----- >>From: "Ron St-Pierre" >>To: "Raul Secan" ; >>Sent: Thursday, March 18, 2004 5:57 PM >>Subject: Re: [PHP] running postgresql as a linux service >> >> >>Raul Secan wrote: >> >> >> >> >> >>>Hello, I have succesfuly installed PostgreSQL 7.4.1, on my OS which is >>>Red Hat Linux 9.0. >>> >>>I start the server with: >>>$ pg_ctl -D /usr/local/pgsql/data -l logfile start >>> >>>And stop it with: >>>$ pg_ctl -D /usr/local/pgsql/data stop -m fast >>> >>>There are two questions here, which I want to put to you guys: >>>1. How can make PostgreSQL run as a Linux service so database server >>>starts at each reboot >>> >>> >>> >>> >>Below are the steps I use when I manually install PostgreSQL to have it >>running when the server starts. However I don't use Red Hat, I use >>Mandrake instead. You should be able to find the corresponding files on >>your server if you know the installation directories for your >>PostgreSQL, or use utilities like 'locate' or 'find' to find out where >>they are installed. >> >> >> >>*as root*: >>- Configure the PostgreSQL SysV Script. This script is useful for >>starting, stopping, and checking the status of PostgreSQL. >> >># cd /usr/local/src/postgresql-7.x >># cp contrib/start-scripts/linux /etc/init.d/postgres >># chmod 755 /etc/init.d/postgres >>.... then edit the file to specify the data directory, etc. and sets the >>environment variabes (PGDATA etc). The file is well documented. If you >>installed Postgres manually, it should have the correct values already set. >> >>- To have PostgreSQL start automatically when the computer boots add >>symbolic links from the correct /etc/rc*.d/ directories to >>/etc/init.d/postgres. If the normal runlevel is 3 then you really only >>need to add it to rc3.d: >> >># ln -s /etc/init.d/postgres /etc/rc2.d/S85postgres >># ln -s /etc/init.d/postgres /etc/rc3.d/S85postgres >> >>etc ... >> >>- Start PostgreSQL for the first time: >> >># /etc/init.d/postgres start >> >><\start> >> >> >> >> >> >>>2. How can I register the PGDATA environment variable, so I don't have >>>to use -D /usr/local/pgsql/data parameter (and don't use -l logfile if >>>it is posible) when run the start command >>> >>> >>> >>> >>> >>If step 1. works correctly, the PGDATA variable is set properly. >>Otherwise edit the /etc/init.d/postgres file. >> >> >> >> >> >>>Thanks, Raul Secan. >>> >>> >>> >>> >>Ron >> >> >> >> >>---------------------------(end of broadcast)--------------------------- >>TIP 4: Don't 'kill -9' the postmaster >> >> >> >> >> >> > > > >