By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,693 Members | 1,972 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,693 IT Pros & Developers. It's quick & easy.

forking postmaster on my own - not as pguser

P: n/a
I have a need to run postgres only when my Java application is running.
Basically I want to do a Runtime.exec() from java in order to start up the
DB server. Is there any reason why this should present a problem? My
init.d script is su-ing to the pguser before launching pg_ctl with all the
various params. Can I just emulate this, but not su to the pguser account
but use the exisitng user logon? Also, besides standard unix safety rules
about limited access accounts and all, is there any reason I HAVE to be
the pguser to start up postgres?

Thanks,

Gregory

=====
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
Gregory Stone | "Suppose you were an idiot, and suppose you were
gu***@yahoo.com | a member of congress; but I repeat myself."
| - Mark Twain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~

__________________________________
Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003
http://search.yahoo.com/top2003

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Mon, 5 Jan 2004, Gregory Stone wrote:
I have a need to run postgres only when my Java application is running.
Basically I want to do a Runtime.exec() from java in order to start up the
DB server. Is there any reason why this should present a problem? My
init.d script is su-ing to the pguser before launching pg_ctl with all the
various params. Can I just emulate this, but not su to the pguser account
but use the exisitng user logon? Also, besides standard unix safety rules
about limited access accounts and all, is there any reason I HAVE to be
the pguser to start up postgres?


No need to be the pguser user at all. Any user of the system can run a postgres
cluster. Note, that is a postgres cluster, i.e. if you're trying to start
postgres to look at databases in a cluster that was built by a different user
then it isn't going to work.

So in summary, what you want to do is something like:

initdb -D /home/myuser/data blah blah blah
pg_ctl -D /home/myuser/data blah blah blah
createdb -D /home/myuser/data blah blah blah
all the other stuff to build your DBs and then you just need to fork and exec
as myuser in your application.
--
Nigel Andrews

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

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.