Re: [BUGS] BUG #8177: initscript should create /var/run/postgresql - Mailing list pgsql-pkg-debian

From stronny red
Subject Re: [BUGS] BUG #8177: initscript should create /var/run/postgresql
Date
Msg-id CALOvDf7fpScGUJBai69S3=Mr5wC-Xj5BZEqnV4qQBjOHXcj+Zg@mail.gmail.com
Whole thread Raw
In response to Re: [BUGS] BUG #8177: initscript should create /var/run/postgresql  (Christoph Berg <myon@debian.org>)
Responses Re: [BUGS] BUG #8177: initscript should create /var/run/postgresql  (Christoph Berg <myon@debian.org>)
List pgsql-pkg-debian
I was able to reproduce the problem.

Package versions
-----------------
ii  postgresql-9.2                      9.2.4-1.pgdg60+1             object-relational SQL database, version 9.2 server
ii  postgresql-common                   142.pgdg60+1                 PostgreSQL database-cluster manager

The failure
-----------------
# /etc/init.d/postgresql stop
# rm -rf /var/run/postgresql
# /etc/init.d/postgresql start
Error: Cannot stat /var/run/postgresql
No PostgreSQL clusters exist; see "man pg_createcluster" ... (warning).

The config file
-----------------
# ls -lA /etc/postgresql/9.2
total 0
lrwxrwxrwx 1 root root 23 May 22 20:36 main -> /var/lib/postgresql/etc
# cat /etc/postgresql/9.2/main/postgresql.conf 
data_directory = '/var/lib/postgresql/9.2/main'
hba_file = '/var/lib/postgresql/etc/pg_hba.conf'
external_pid_file = '/var/run/postgresql/9.2-main.pid'
ssl = true
ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'
ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key'
log_line_prefix = '%t '
log_timezone = 'Europe/Moscow'

listen_addresses = '*'
wal_level = hot_standby
max_wal_senders = 3
wal_keep_segments = 8



On Thu, May 30, 2013 at 6:58 AM, Christoph Berg <myon@debian.org> wrote:
On Mon, 2013-05-27 at 09:27 +0000, stronny@celestia.ru wrote:
> The following bug has been logged on the website:
>
> Bug reference:      8177
> Logged by:          stronny
> Email address:      stronny@celestia.ru
> PostgreSQL version: 9.2.4
> Operating system:   wheezy
> Description:
>
> When installed from apt.postgresql.org Postgres fails to start on system
> boot.
>
> Wheezy changed /var/run to become memory-based so initscript should create
> /var/run/postgresql if necessary.

start() {
    # create socket directory
    if [ -d /var/run/postgresql ]; then
        chmod 2775 /var/run/postgresql
    else
        install -d -m 2775 -o postgres -g postgres /var/run/postgresql
    fi

    do_ctl_all start "$1" "Starting PostgreSQL $1 database server"
}

We create the directory, what specifically doesn't work for you?

Christoph
--
cb@df7cb.de | http://www.df7cb.de/

pgsql-pkg-debian by date:

Previous
From: Christoph Berg
Date:
Subject: Re: [BUGS] BUG #8177: initscript should create /var/run/postgresql
Next
From: Christoph Berg
Date:
Subject: Re: [BUGS] BUG #8177: initscript should create /var/run/postgresql