View previous topic :: View next topic |
Author |
Message |
jeffk l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 13 Sep 2003 Posts: 671
|
Posted: Tue Mar 09, 2004 5:06 pm Post subject: pg_ctl: couldnt find /var/lib/postgresql/data/postmaster.pid |
|
|
I'm trying to get postgresql-7.4.1-r4 configured, and am having trouble with the postgres user and startup scripts.
I emerged postgresql without first having created the 'postgres' user and group. I did create the postgres user with useradd, but I only followed the 'everyday user' useradd pattern, and ended up with a /home/postgres directory, which I want to omit. I removed postgres from the 'wheel', and 'audio' groups (in /etc/group), and created a 'postgres' group, adding 'postgres' user. I then deleted /home/postgres, unsure if that would be a problem (see below)
As root, I ran:
Code: | mkdir -p /var/lib/postgresql/data
chown -Rf postgres:postgres /var/lib/postgresql
chmod 700 /var/lib/postgresql/data
sudo -u postgres /usr/bin/initdb --pgdata /var/lib/postgresql/data |
I tried to rework the postgres user to have a home directory similar to the way my redhat server does it:
Code: | /etc/passwd
postgres:x:1003:100::/var/lib/postgresql:/bin/bash
/etc/group
postgres:x:441:postgres |
But I don't think the postmaster is starting correctly:
Code: | root@hostname data # /etc/init.d/postgresql restart
* Restarting PostgreSQL...
pg_ctl: could not find /var/lib/postgresql/data/postmaster.pid
Is postmaster running?
starting postmaster anyway [ ok ] |
Any ideas? I'm willing to rip out the postgres user/group and start from scratch if anyone has a step-by-step recipe to follow. Thanks. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
jeffk l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 13 Sep 2003 Posts: 671
|
Posted: Tue Mar 09, 2004 5:17 pm Post subject: |
|
|
One update, I checked another gentoo server, and apparently the emerge had created a postgres user, so I copied those group and passwd entries back to my laptop:
postgres:x:70:70::/var/lib/postgresql:/bin/bash
postgres::70:
problem of the missing pid is still there. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
DarKRaveR Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 11 Oct 2003 Posts: 500 Location: Old Europe/G-Many
|
Posted: Tue Mar 09, 2004 11:14 pm Post subject: |
|
|
First off:
it doesn't really matter which UID the user has etc. you can chown the corresponding files etc. anyway, so the user fits.
To your problem. why do you want to restart postgres ? if it isn'T running, there's no pid, ergo pg_ctl can'T find one.
Make sure, to have a look at /etc/conf.d/posgresql
Just in case you got different file locations etc. (like me).
Oh, and I ctually pointed the postgres users homedir to the postgres main directory (above data) ... shouldn'T be a problem, to have it anywhere, as long as it exists ....
You can even give the user a homedir ... and in /etc/conf.d/posgres.. you can set the datapath etc. - This should work. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|