Bug 12782 - postgresql 9.3 server fails to start (missing /var/run/postgresql/)
Summary: postgresql 9.3 server fails to start (missing /var/run/postgresql/)
Status: RESOLVED DUPLICATE of bug 13241
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 4
Hardware: i586 Linux
Priority: High critical
Target Milestone: ---
Assignee: Funda Wang
QA Contact:
URL:
Whiteboard:
Keywords: Triaged
Depends on: 12841
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-15 21:40 CET by Samuel Verschelde
Modified: 2014-05-07 20:16 CEST (History)
4 users (show)

See Also:
Source RPM: postgresql9.3-9.3.2-2.mga4.src.rpm
CVE:
Status comment:


Attachments

Description Samuel Verschelde 2014-02-15 21:40:09 CET
After installing postgresql9.3-server, systemctl start postgresql.service fails

[root@localhost ~]# systemctl start postgresql.service 
Job for postgresql.service failed. See 'systemctl status postgresql.service' and 'journalctl -xn' for details.

[root@localhost ~]# systemctl status postgresql.service 
postgresql.service - PostgreSQL database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled)
   Active: failed (Result: exit-code) since sam. 2014-02-15 21:38:12 CET; 27s ago
  Process: 3780 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=exited, status=1/FAILURE)
  Process: 3777 ExecStartPre=/usr/libexec/postgresql_initdb.sh ${PGDATA} (code=exited, status=0/SUCCESS)

févr. 15 21:38:07 localhost.localdomain pg_ctl[3780]: FATAL:  could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": No such file or directory
févr. 15 21:38:12 localhost.localdomain pg_ctl[3780]: pg_ctl: could not start server
févr. 15 21:38:12 localhost.localdomain pg_ctl[3780]: Examine the log output.
févr. 15 21:38:12 localhost.localdomain systemd[1]: postgresql.service: control process exited, code=exited status=1
févr. 15 21:38:12 localhost.localdomain systemd[1]: Failed to start PostgreSQL database server.
févr. 15 21:38:12 localhost.localdomain systemd[1]: Unit postgresql.service entered failed state.

[root@localhost ~]# rpm -qa | grep postgresql
postgresql9.3-9.3.2-2.mga4
postgresql9.3-server-9.3.2-2.mga4
postgresql9.3-plpgsql-9.3.2-2.mga4


Reproducible: 

Steps to Reproduce:
Manuel Hiebel 2014-02-16 18:13:29 CET

Keywords: (none) => Triaged
Assignee: bugsquad => fundawang

David Walser 2014-03-02 16:06:34 CET

Depends on: (none) => 12841

Comment 1 Markus Mertens 2014-03-13 09:57:20 CET
(In reply to Samuel VERSCHELDE from comment #0)


I have the same problem with postgresql-9.1 on Mageia 4 (x86_64). The problem seems to be that the missing socket is being created in /tmp:

# ls /tmp/.s.*
/tmp/.s.PGSQL.5432=  /tmp/.s.PGSQL.5432.lock

But I do not know how to create that socket in the correct directory.



# rpm -qa | grep postgres
postgresql9.1-plpgsql-9.1.11-2.mga4
postgresql9.1-devel-9.1.11-2.mga4
postgresql9.1-plpython-9.1.11-2.mga4
postgresql9.1-plperl-9.1.11-2.mga4
postgresql9.1-server-9.1.11-2.mga4
postgresql9.1-9.1.11-2.mga4
postgresql9.1-pl-9.1.11-2.mga4
postgresql9.1-pltcl-9.1.11-2.mga4
postgresql-jdbc-9.2.1002-6.mga4

CC: (none) => Mertens.MPT

Comment 2 Samuel Verschelde 2014-03-13 10:02:47 CET
Adding Olivier Thauvin for insight

CC: (none) => nanardon

Comment 3 Markus Mertens 2014-03-17 09:18:34 CET
(In reply to Markus Mertens from comment #1)
> (In reply to Samuel VERSCHELDE from comment #0)
> 
> 
> I have the same problem with postgresql-9.1 on Mageia 4 (x86_64). The
> problem seems to be that the missing socket is being created in /tmp:
> 
> # ls /tmp/.s.*
> /tmp/.s.PGSQL.5432=  /tmp/.s.PGSQL.5432.lock
> 
> But I do not know how to create that socket in the correct directory.
> 
> 
> 
> # rpm -qa | grep postgres
> postgresql9.1-plpgsql-9.1.11-2.mga4
> postgresql9.1-devel-9.1.11-2.mga4
> postgresql9.1-plpython-9.1.11-2.mga4
> postgresql9.1-plperl-9.1.11-2.mga4
> postgresql9.1-server-9.1.11-2.mga4
> postgresql9.1-9.1.11-2.mga4
> postgresql9.1-pl-9.1.11-2.mga4
> postgresql9.1-pltcl-9.1.11-2.mga4
> postgresql-jdbc-9.2.1002-6.mga4


Even if I set unix_socket_directory = '/var/run/postgresql' in /var/lib/pgsql/data/postgresql.conf the socket is not being created in the right place. Actually, not even the directory (/var/run/postgresql) is being created. There is no way to start postgresql in another directory than in /tmp.

Priority: Normal => High

Comment 4 Alexandr Bezenkov 2014-04-11 08:48:54 CEST
I solved the problem by creating /var/run/postgresql directory and chowning it to postgres:postgres.

CC: (none) => alexandrbezenkov

Comment 5 Markus Mertens 2014-04-11 09:02:15 CEST
(In reply to Alexandr Bezenkov from comment #4)
> I solved the problem by creating /var/run/postgresql directory and chowning
> it to postgres:postgres.

But this is only a temporarily solution until you reboot.
Comment 6 Florian Hubold 2014-04-20 22:23:36 CEST
(In reply to Markus Mertens from comment #5)
> (In reply to Alexandr Bezenkov from comment #4)
> > I solved the problem by creating /var/run/postgresql directory and chowning
> > it to postgres:postgres.
> 
> But this is only a temporarily solution until you reboot.

That's why there is /usr/lib/tmpfiles.d/postgresql.conf

Sadly this bug didn't show up when I posted https://bugs.mageia.org/show_bug.cgi?id=13241 but I'd like to mark this one as duplicate, as I've already commited a fix and the other bug has the missing information.

@Markus: For your issue with /tmp that seems something different and not the same as with stormi or Alexandr and the original report.

*** This bug has been marked as a duplicate of bug 13241 ***

Status: NEW => RESOLVED
CC: (none) => doktor5000
Resolution: (none) => DUPLICATE

David Walser 2014-05-07 20:16:00 CEST

Depends on: (none) => 13336

David Walser 2014-05-07 20:16:40 CEST

Depends on: 13336 => (none)


Note You need to log in before you can comment on or make changes to this bug.