# No PID for postgresql

## pogwizd

Hi,

I've installed postgresql-8.1.3-r1 and libpq-8.1.3-r3. then I use the configuration command:

```
emerge --config =postgresql-8.1.3-r1
```

After that I of course give a password to my postgres user and start it with 

```
/etc/init.d/postgresql start
```

.

So far so good, because postgresql says it started

```
pogwizd-02 pogwizd # /etc/init.d/postgresql start

 * Caching service dependencies ...                                                                                                                                          [ ok ]

 * Starting PostgreSQL ...                                                                                                                                                   [ ok ]
```

But the problem begins now, I tried to install a new user or even a new database, and I get this error (as postgres user naturally)

```
postgres@pogwizd-02 ~ $ createuser -P usertest

Enter password for new role:

Enter it again:

Shall the new role be a superuser? (y/n) y

createuser: could not connect to database postgres: could not connect to server: Connection refused

        Is the server running locally and accepting

        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

postgres@pogwizd-02 ~ $ createdb dbtest

createdb: could not connect to database postgres: could not connect to server: Connection refused

        Is the server running locally and accepting

        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

postgres@pogwizd-02 ~
```

With this message I thougth my postgresql was'nt started, so I tried to take it up again and have:

```
pogwizd-02 pogwizd # /etc/init.d/postgresql start

 * WARNING:  postgresql has already been started.

pogwizd-02 pogwizd #       
```

So I tried to restart it, and then it was worse:

```
pogwizd-02 pogwizd # /etc/init.d/postgresql restart

 * Restarting PostgreSQL ...

pg_ctl: PID file "/var/lib/postgresql/data/postmaster.pid" does not exist

Is postmaster running?

starting postmaster anyway                                                                                                                                                   [ ok ]

pogwizd-02 pogwizd # 
```

So can someone help me, thanks by advance....

----------

## PaulBredbury

Run this:

```
/etc/init.d/postgresql start

ps ax | grep postm
```

You should see:

```
/usr/bin/postmaster -D /var/lib/postgresql/data
```

----------

## pogwizd

I first restart, to be shure that I have not postgres running while doing this, and it gives me this:

```

pogwizd-02 pogwizd # /etc/init.d/postgresql start

 * Starting PostgreSQL ...                                                                                                                                                   [ ok ]

pogwizd-02 pogwizd # ps ax | grep post

 7470 pts/1    S+     0:00 grep post

pogwizd-02 pogwizd #

```

----------

## PaulBredbury

The log file might tell you why it's not starting:  /var/lib/postgresql/data/postgresql.log (as defined in /etc/conf.d/postgresql).

----------

## pogwizd

It shows me this:

 *Quote:*   

> 
> 
> pogwizd-02 pogwizd # cat /var/lib/postgresql/data/postgresql.log
> 
> FATAL:  could not remove old lock file "/tmp/.s.PGSQL.5432.lock": Operation not permitted
> ...

 

So I remove the files /tmp.s.PGSQL.5432 and /tmp.s.PGSQL.5432.lock, and it works

Thanks a lot for the help Paul

----------

