473,322 Members | 1,538 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

forking postmaster on my own - not as pguser

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
1 1359
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Eric S. Johansson | last post by:
I was working on a filter for postfix and instead of using the "fork a new python process on every message" route, I decided to use the SMTP interface instead and try forking after having started...
0
by: SRam | last post by:
I a writing Forking Server for a Small application.. This is code for multiplexing my $listen = IO::Socket::INET->new(Proto => 'tcp',LocalPort => 2323, Listen => 1, Reuse => 1) or die $!; ...
2
by: Andy Harrison | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Could anyone explain about the max_connections in postgres? We ran into the connection limit on one of our production servers. One reason is that we have...
3
by: felixfix | last post by:
Hi all, I am just wondering if something is wrong with my program. What it bascially does is to output a fibonacci sequence base on the command-line output. If I give a 5, it will generate the...
0
by: Melanie Bergeron | last post by:
Hi all! I have a big problem installing postmaster as a service under Windows XP with cygwin. I already installed postgresql on 2 machines without problems but this machine really seem to don't...
8
by: Thomas Hallgren | last post by:
I'm writing a small test harness. I have two threads. One that starts the postmaster and another that does all the testing and finally stops the postmaster with a pg_ctl stop. At present, the...
3
by: czajnik | last post by:
Hi! I'm quite new to Python development. Can someone advise me a framework useful for building (pre-)forking or threaded TCP servers, other than SocketServer ? I've seen source code of a few...
10
by: qwertycat | last post by:
I'm new to multi-process programming, should one avoid forking children from children of a parent? I'd like to spawn 10 children from the parent and each of those children spawns another 5...
2
by: Gilles Ganault | last post by:
Hello I'd like to rewrite the following Perl script in Python: http://www.voip-info.org/wiki/view/Asterisk+NetCID It seems like the following doesn't actually fork, so Asterisk is stuck...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.