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 ;-) |
Silly question here ... why don't you just edit the script? :)
Cheers, Tink |
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? |
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 |
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. |
All times are GMT -5. The time now is 08:00 AM. |