how to auto start "postmaster"?

Started by Terence Leungalmost 24 years ago3 messagesgeneral
Jump to latest
#1Terence Leung
tcmleung@yahoo.com

Dear sir,
I am using Redhat Linux 6.2 and postgresql 7.0.
I want to auto-run "postmaster -i &" after booting
the Linux. I write a shell script in /etc/rc.d/rc4.d
so that it would be run after start up.
"----------------
#!/bin/sh
postmaster -i &
----------------"
However, I know postmaster cannot be run by "root"
but "postgres".
What can I do, how to modify the code so that the
script can be run by postgres?
Please help!!!
Thank you.

=====
Terence Leung,
Mobile: 9273 9176
email: tcmleung@yahoo.com,
Homepage:http://tcmleung.uhome.net

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

#2Darren Ferguson
darren@crystalballinc.com
In reply to: Terence Leung (#1)
Re: how to auto start "postmaster"

Script fo that was sent yesterday

what you do is

su postgres -c "then the command goes in here"

HTH

Darren Ferguson

On Wed, 12 Jun 2002, Terence Leung wrote:

Show quoted text

Dear sir,
I am using Redhat Linux 6.2 and postgresql 7.0.
I want to auto-run "postmaster -i &" after booting
the Linux. I write a shell script in /etc/rc.d/rc4.d
so that it would be run after start up.
"----------------
#!/bin/sh
postmaster -i &
----------------"
However, I know postmaster cannot be run by "root"
but "postgres".
What can I do, how to modify the code so that the
script can be run by postgres?
Please help!!!
Thank you.

=====
Terence Leung,
Mobile: 9273 9176
email: tcmleung@yahoo.com,
Homepage:http://tcmleung.uhome.net

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

#3Thomas Beutin
tyrone@laokoon.IN-Berlin.DE
In reply to: Terence Leung (#1)
Re: how to auto start "postmaster"?

Hi,

root is not allowed to start the postmaster. You should try something
like su - <database-user> -c "postmaster -i &" instead (by replacing
with the correct database user on Your system), but there are different
su versions. Have a look into the manpage first to figure out the
correct command line.

Greetings!
-tb

On Wed, Jun 12, 2002 at 12:50:23AM -0700, Terence Leung wrote:

Dear sir,
I am using Redhat Linux 6.2 and postgresql 7.0.
I want to auto-run "postmaster -i &" after booting
the Linux. I write a shell script in /etc/rc.d/rc4.d
so that it would be run after start up.
"----------------
#!/bin/sh
postmaster -i &
----------------"
However, I know postmaster cannot be run by "root"
but "postgres".
What can I do, how to modify the code so that the
script can be run by postgres?
Please help!!!
Thank you.

=====
Terence Leung,
Mobile: 9273 9176
email: tcmleung@yahoo.com,
Homepage:http://tcmleung.uhome.net

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

--
Thomas Beutin tb@laokoon.IN-Berlin.DE
Beam me up, Scotty. There is no intelligent live down in Redmond.