LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-25-2003, 05:42 PM   #1
lolmc
Member
 
Registered: Nov 2001
Location: Wirral.Merseyside - UK
Distribution: Mandrake 10.0 on desktop and 9.2 laptop
Posts: 60

Rep: Reputation: 15
Angry starting postgres 7.2.2


Hi folks can anyone help with this?I installed Postgres 7.2.2 on my Mandrake 9.0 system using the distro supplied rpm.Using webmin I can see that the way it is started and stopped is by a script called postgresql in the /etc/rc.d/init.d dir - but this script does not use the -i option to allow TCP/IP connections to the server.
I couldn't find a way to add this option to the script so i had to resort to using
postmaster -D /var/lib/pgsql/data -i -l serverlog
at the command line and then shutting it down manually as well.I would much prefer to use the script above but need help to add the TCP/IP option.
hope you can help.
Lol ;-)
 
Old 02-25-2003, 08:16 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,978
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
Silly question here ... why don't you just edit the script? :)


Cheers,
Tink
 
Old 02-26-2003, 02:43 AM   #3
lolmc
Member
 
Registered: Nov 2001
Location: Wirral.Merseyside - UK
Distribution: Mandrake 10.0 on desktop and 9.2 laptop
Posts: 60

Original Poster
Rep: Reputation: 15
Sorry my post was ambiguous - I meant that I tried to edit it but could not get the -i option to work on the lines in the script which started and stopped postgres below :-

su -l postgres -s /bin/sh -c "/usr/bin/initdb --pgdata=/var/lib/pgsql/data > /dev/null 2>&1" < /dev/null
[ -f $PGDATA/PG_VERSION ] && echo_success
[ ! -f $PGDATA/PG_VERSION ] && echo_failure
echo
# Check for postmaster already running...
pid=`pidof -s postmaster`
if [ $pid ]
then
gprintf "Postmaster already running.\n"
else
#all systems go -- remove any stale lock files
rm -f /tmp/.s.PGSQL.* > /dev/null
gprintf "%s" "$PSQL_START"
su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p /usr/bin/postmaster start > /dev/null 2>&1" < /dev/null
sleep 1
pid=`pidof -s postmaster`
if [ $pid ]
then
success "%s" "$PSQL_START"
touch /var/lock/subsys/postgresql
echo $pid > /var/run/postmaster.pid
else
failure "%s" "$PSQL_START"
fi
fi
}
I have tried the -i option after the -D option/before it etc but could not get postgres to start this way.Can someone help?

Last edited by lolmc; 02-26-2003 at 03:02 AM.
 
Old 02-26-2003, 03:10 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,978
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
Since your script is using pg_ctl to start
postgres, and from what I understood from
pg_ctl (or rather didn't understand from it's
usage of postmaster.opts and postmaster.opts.def)
I'd say your safest bet would be to modify
your postgresql.conf in setting/adding
tcpip_socket=true.

Cheers,
Tink
 
Old 02-26-2003, 03:30 PM   #5
m0rl0ck
Member
 
Registered: Nov 2002
Distribution: A totally 133t distro :)
Posts: 358

Rep: Reputation: 31
in the init script youll find a line like so:
su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p /usr/bin/postmaster start > /dev/null 2>&1" < /dev/null

change it to:

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


note the "-i"
you might also want to look at the use of the -o flag in the pg_ctl man page.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Postgres Hiper1 Linux - Newbie 8 04-10-2005 05:43 PM
postgres and mysql varun_33 Linux - Software 1 02-12-2005 07:54 AM
Starting up a service (Postgres) on boot aa2bi Linux - Newbie 1 06-15-2004 05:34 PM
Postgres DBMS??! Hady Linux - Newbie 4 04-27-2004 03:19 PM
postgres data jamna17 Linux - Newbie 4 04-07-2004 05:45 AM


All times are GMT -5. The time now is 07:45 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration