LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Can't Start postgresql server on OpenSuSE 10.3 (https://www.linuxquestions.org/questions/linux-software-2/can%27t-start-postgresql-server-on-opensuse-10-3-a-621274/)

billmasters 02-15-2008 02:09 AM

Can't Start postgresql server on OpenSuSE 10.3
 
Hi all,
I installed postgresql 8.2.6 from source and everything went well but once I shutdown the postgresql server, I can't get it to startup again even as root. I'm using the following command:
/usr/local/pgsql/bin/pg_ctl start -w -D /usr/local/pgsql/data -l logfile
(/usr/local/pgsql was where postgresql was installed through the installation guide)
It also gives me an error of "Unable to open logfile; You don't have sufficient rights" (or something like that) even as user postgres.
What am I supposed to do and how do I allow a new user to modify .../pgsql/data folder without affecting the installation. (I need this rights since I wanna install Slony-I and pgAdmin once am done)

Victor

reddazz 02-16-2008 10:52 AM

Hi and welcome to LQ. Try
Code:

chown -R postgres:postgres /usr/local/pgsql
chown -R postgres:postgres /usr/local/pgsql/data

After that try restarting postgresql.

billmasters 02-17-2008 11:27 PM

Hi,
Thanks. its now starting.
One more thing though, where should I put the command to start the server so that it starts once the system boots since I cant use the dafault postgresql start command (the command tries to start the postgresql that comes with the OpenSuSE) and the machines is going to be an automated replication machine.

Victor

reddazz 02-18-2008 03:25 AM

If you have another postgresql installed, I think your best bet would be to put the commands that you use to start the new installation in /etc/init.d/boot.local.

billmasters 02-19-2008 02:14 AM

Thanks, but there is still something else. This is the command:
Code:

/usr/local/pgsql/bin/pg_ctl start -w -D /usr/local/pgsql/data -l /usr/local/pgsql/data/logfile
but the command as to be ran as user postgres to start the server. So do I include the command as
Code:

su postgres
password .........
/usr/local/pgsql/bin/pg_ctl start -w -D /usr/local/pgsql/data -l /usr/local/pgsql/data/logfile;

or just the first code with a ';' at the end?

Tinkster 02-19-2008 12:32 PM

Normally postgres comes with a "ready to use" startup
script in contrib/startup-scripts/ .... copy that to
your /etc/init.d, modify it to your needs (think of
the script as a template or guideline), and then make
the appropriate symlink(s) in the /etc/init.d/rcX.d
directories ... that script takes care of the user
account and all that.



Cheers,
Tink

reddazz 02-19-2008 01:16 PM

Since you already have another postgresql script from openSUSE in /etc/init.d, make sure you use a different name for your script when you copy it to /etc/init.d. If you named your script something like pqsql, you can then add it to your startup scripts by doing
Code:

#chkconfig --add pgsql
You can then start it by doing
Code:

#service pgsql start
or
Code:

#/etc/init.d/pgsql start
To start postgresql at boot up
Code:

#chkconfig pgsql on

Tinkster 02-19-2008 03:21 PM

Where did the idea of a pre-existing rpm based install sneak in?
He didn't mention that anywhere ...


Cheers,
Tink

reddazz 02-19-2008 04:59 PM

Quote:

Originally Posted by Tinkster (Post 3062948)
Where did the idea of a pre-existing rpm based install sneak in?
He didn't mention that anywhere ...


Cheers,
Tink

Its mentioned in post 3.

Tinkster 02-19-2008 05:17 PM

oooops :}


My apologies.


Cheers,
Tink

Tinkster 02-19-2008 05:22 PM

Quote:

Originally Posted by billmasters (Post 3060937)
Hi,
Thanks. its now starting.
One more thing though, where should I put the command to start the server so that it starts once the system boots since I cant use the dafault postgresql start command (the command tries to start the postgresql that comes with the OpenSuSE) and the machines is going to be an automated replication machine.

Victor



You may want to either un-install the SuSE supplied one,
or hunt down the postgresql.conf for this instance and
make sure that the two aren't trying to use the same
port and socket. Either of these two will stop the
second to come instance to fail starting.


Cheers,
Tink

billmasters 02-20-2008 03:03 AM

Thanks guys,
Will try it out now.


All times are GMT -5. The time now is 08:57 AM.