How can I set postmaster as a service

Started by shreedharover 22 years ago8 messagesgeneral
Jump to latest
#1shreedhar
shreedhar@lucidindia.net

How can I set postmaster (database on) as a service and set it while system
booting if self?

Regards
Sreedhar Bhaskararaju

#2Thomas Wegner
thomas@wegner24.de
In reply to: shreedhar (#1)
Re: How can I set postmaster as a service

#!/bin/sh
cygrunsrv --install PostgreSQL \
--path /usr/bin/postmaster \
--args "-D /usr/share/postgresql/data -i" \
--dep ipc-daemon2 \
--termsig INT \
--user Administrator \
--shutdown
--

Thomas Wegner

""shreedhar"" <shreedhar@lucidindia.net> schrieb im Newsbeitrag
news:003901c373a0$8a297440$1201a8c0@a4005...
How can I set postmaster (database on) as a service and set it while system
booting if self?

Regards
Sreedhar Bhaskararaju

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

#3Jeffrey Melloy
jmelloy@visualdistortion.org
In reply to: shreedhar (#1)
Re: [GENERAL] How can I set postmaster as a service

shreedhar wrote:

How can I set postmaster (database on) as a service and set it while system
booting if self?

What operating system are you using?
Jeff

#4Darko Prenosil
darko.prenosil@finteh.hr
In reply to: shreedhar (#1)
Re: How can I set postmaster as a service

----- Original Message -----
From: "Jeffrey Melloy" <jmelloy@visualdistortion.org>
To: "shreedhar" <shreedhar@lucidindia.net>
Cc: "Postgre Admin" <pgsql-admin@postgresql.org>; "Postgre General"
<pgsql-general@postgresql.org>
Sent: Friday, September 05, 2003 7:32 PM
Subject: Re: [GENERAL] How can I set postmaster as a service

shreedhar wrote:

How can I set postmaster (database on) as a service and set it while

system

booting if self?

If this is linux, there is startup script in contrib dir. Copy the script to
/etc/init.d or something similar, depending on linux distribution, and do
the setup to activate postgres service on boot.

Regards !

#5shreedhar
shreedhar@lucidindia.net
In reply to: Darko Prenosil (#4)
Re: [GENERAL] How can I set postmaster as a service

I already had postgresql file in /etc/rc.d/init.d.
I run the following ln commands as specified.
if I boot my system it is opening database. But failing while opening
database by remote host.
May be -i option is missing.

If I use the following line in postgresql file
su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p
/usr/bin/postmaster -o '-p ${PGPORT}' start > /dev/null 2>&1" < /dev/null

I could able to start database but I could not able to connect through
remost host.

If I change the option -o to -i I am getting an error while starting
database itself.

su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p
/usr/bin/postmaster -i '-p ${PGPORT}' start > /dev/null 2>&1" < /dev/null

How can I rectify this error.

----- Original Message -----
From: "Reid Thompson" <Reid.Thompson@ateb.com>
To: "shreedhar" <shreedhar@lucidindia.net>
Sent: Friday, September 05, 2003 11:20 PM
Subject: RE: [GENERAL] How can I set postmaster as a service

Show quoted text

basically, mod the start script as necessary for your system.
cp it to /etc/init.d as postgresqlscript or whatever you want to call it
cd to /etc/rc3.d
ln -s ../init.d/postgresqlscript S95postgresql
ln -s ../init.d/postgresqlscript K94postgresql

reid

-----Original Message-----
From: shreedhar [mailto:shreedhar@lucidindia.net]
Sent: Friday, September 05, 2003 9:31 AM
To: Postgre Admin; Reid Thompson
Subject: Re: [GENERAL] How can I set postmaster as a service

It is RHLinux 7.3.

----- Original Message -----
From: "Reid Thompson" <Reid.Thompson@ateb.com>
To: "shreedhar" <shreedhar@lucidindia.net>
Sent: Friday, September 05, 2003 6:49 PM
Subject: RE: [GENERAL] How can I set postmaster as a service

what operating system

reid

-----Original Message-----
From: shreedhar [mailto:shreedhar@lucidindia.net]
Sent: Friday, September 05, 2003 7:26 AM
To: Postgre Admin; Postgre General
Subject: [GENERAL] How can I set postmaster as a service

How can I set postmaster (database on) as a service and set
it while system booting if self?

Regards
Sreedhar Bhaskararaju

---------------------------(end of
broadcast)---------------------------
TIP 2: you can get off all lists at once with the

unregister command

(send "unregister YourEmailAddressHere" to
majordomo@postgresql.org)

#6Jean-Michel Chabanne
jeanmichel.chabanne@free.fr
In reply to: shreedhar (#5)
Re: [GENERAL] How can I set postmaster as a service

shreedhar a �crit :

I already had postgresql file in /etc/rc.d/init.d.
I run the following ln commands as specified.
if I boot my system it is opening database. But failing while opening
database by remote host.
May be -i option is missing.

If I use the following line in postgresql file
su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p
/usr/bin/postmaster -o '-p ${PGPORT}' start > /dev/null 2>&1" < /dev/null

I could able to start database but I could not able to connect through
remost host.

If I change the option -o to -i I am getting an error while starting
database itself.

su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p
/usr/bin/postmaster -i '-p ${PGPORT}' start > /dev/null 2>&1" < /dev/null

How can I rectify this error.

-o means options. All options follow beetween quotes.

... -o ' -p ${PGPORT} -i ' ...

----- Original Message -----
From: "Reid Thompson" <Reid.Thompson@ateb.com>
To: "shreedhar" <shreedhar@lucidindia.net>
Sent: Friday, September 05, 2003 11:20 PM
Subject: RE: [GENERAL] How can I set postmaster as a service

basically, mod the start script as necessary for your system.
cp it to /etc/init.d as postgresqlscript or whatever you want to call it
cd to /etc/rc3.d
ln -s ../init.d/postgresqlscript S95postgresql
ln -s ../init.d/postgresqlscript K94postgresql

reid

-----Original Message-----
From: shreedhar [mailto:shreedhar@lucidindia.net]
Sent: Friday, September 05, 2003 9:31 AM
To: Postgre Admin; Reid Thompson
Subject: Re: [GENERAL] How can I set postmaster as a service

It is RHLinux 7.3.

----- Original Message -----
From: "Reid Thompson" <Reid.Thompson@ateb.com>
To: "shreedhar" <shreedhar@lucidindia.net>
Sent: Friday, September 05, 2003 6:49 PM
Subject: RE: [GENERAL] How can I set postmaster as a service

what operating system

reid

-----Original Message-----
From: shreedhar [mailto:shreedhar@lucidindia.net]
Sent: Friday, September 05, 2003 7:26 AM
To: Postgre Admin; Postgre General
Subject: [GENERAL] How can I set postmaster as a service

How can I set postmaster (database on) as a service and set
it while system booting if self?

Regards
Sreedhar Bhaskararaju

---------------------------(end of
broadcast)---------------------------
TIP 2: you can get off all lists at once with the

unregister command

(send "unregister YourEmailAddressHere" to
majordomo@postgresql.org)

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

--
Jean-Michel Chabanne
77450 MONTRY (FRANCE)
48" 54' N - 2" 49' E
Powered by Linux

#7Darko Prenosil
darko.prenosil@finteh.hr
In reply to: shreedhar (#5)
Re: How can I set postmaster as a service

----- Original Message -----
From: "shreedhar" <shreedhar@lucidindia.net>
To: "Postgre Admin" <pgsql-admin@postgresql.org>; "Postgre General"
<pgsql-general@postgresql.org>; "Reid Thompson" <Reid.Thompson@ateb.com>
Sent: Saturday, September 06, 2003 10:53 AM
Subject: Re: [GENERAL] How can I set postmaster as a service

I already had postgresql file in /etc/rc.d/init.d.
I run the following ln commands as specified.
if I boot my system it is opening database. But failing while opening
database by remote host.
May be -i option is missing.

If I use the following line in postgresql file
su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p
/usr/bin/postmaster -o '-p ${PGPORT}' start > /dev/null 2>&1" < /dev/null

I could able to start database but I could not able to connect through
remost host.

If I change the option -o to -i I am getting an error while starting
database itself.

su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p
/usr/bin/postmaster -i '-p ${PGPORT}' start > /dev/null 2>&1" < /dev/null

How can I rectify this error.

You do not need to change startup script, becuause there is option for
enabling tcp/ip in the postgresql configuration file.

Regards !

#8Paul Thomas
paul@tmsl.demon.co.uk
In reply to: shreedhar (#5)
Re: How can I set postmaster as a service

On 06/09/2003 09:53 shreedhar wrote:

I already had postgresql file in /etc/rc.d/init.d.
I run the following ln commands as specified.
if I boot my system it is opening database. But failing while opening
database by remote host.
May be -i option is missing.

If I use the following line in postgresql file
su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p
/usr/bin/postmaster -o '-p ${PGPORT}' start > /dev/null 2>&1" < /dev/null

I could able to start database but I could not able to connect through
remost host.

If I change the option -o to -i I am getting an error while starting
database itself.

su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p
/usr/bin/postmaster -i '-p ${PGPORT}' start > /dev/null 2>&1" < /dev/null

How can I rectify this error.

su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p
/usr/bin/postmaster '-p ${PGPORT}' start -o \" -i \" > /dev/null 2>&1" <
/dev/null

or in postgresql.conf

tcpip_socket = true

HTH

-- 
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller 
Business |
| Computer Consultants         | 
http://www.thomas-micro-systems-ltd.co.uk   |
+------------------------------+---------------------------------------------+