2

We have an application that is running on RHEL6/32 bit and RHEL6/64 bit. This application uses postgresql 8.4 from the beginning. Now, we want to provide support for this application on RHEL7/64 bit. RHEL7 comes with default postgresql 9.2 in its yum list and this is getting installed and its related services are running properly as well. But after installing postgresql 8.4 on RHEL7, it seems like the services are never running. Please find below the logs:

[root@linpubn218 postgres]# service postgresql status
postgresql.service - SYSV: PostgreSQL database server.
   Loaded: loaded (/etc/rc.d/init.d/postgresql)
      Active: failed (Result: resources) since Mon 2016-07-25 12:40:28 IST; 2h 0min ago
           Docs: man:systemd-sysv-generator(8)

Jul 25 12:40:26 linpubn218.gl.avaya.com systemd[1]: Starting SYSV: PostgreSQL database server....
Jul 25 12:40:28 linpubn218.gl.avaya.com postgresql[26957]: Starting postgresql service: [  OK  ]
Jul 25 12:40:28 linpubn218.gl.avaya.com systemd[1]: PID file /var/run/postmaster-8.4.pid not readable (yet?) after start.
Jul 25 12:40:28 linpubn218.gl.avaya.com systemd[1]: Failed to start SYSV: PostgreSQL database server..
Jul 25 12:40:28 linpubn218.gl.avaya.com systemd[1]: Unit postgresql.service entered failed state.
Jul 25 12:40:28 linpubn218.gl.avaya.com systemd[1]: postgresql.service failed.
Jul 25 14:33:45 linpubn218.gl.avaya.com systemd[1]: Unit postgresql.service cannot be reloaded because it is inactive.
Jul 25 14:33:45 linpubn218.gl.avaya.com systemd[1]: Unit postgresql.service cannot be reloaded because it is inactive.

After looking at the logs in journalctl -xe

[root@linpubn218 postgres]# journalctl -xe
Jul 25 14:39:21 linpubn218.gl.avaya.com yum[29260]: Installed: postgresql84-libs-8.4.17-1PGDG.rhel6.x86_64
Jul 25 14:39:45 linpubn218.gl.avaya.com yum[29275]: Installed: postgresql84-8.4.17-1PGDG.rhel6.x86_64
Jul 25 14:40:01 linpubn218.gl.avaya.com useradd[29316]: failed adding user 'postgres', exit code: 9
Jul 25 14:40:02 linpubn218.gl.avaya.com CROND[29320]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Jul 25 14:40:02 linpubn218.gl.avaya.com systemd[1]: Reloading.
Jul 25 14:40:03 linpubn218.gl.avaya.com systemd[1]: Configuration file /usr/lib/systemd/system/auditd.service is marked world-inaccessible. This has no effect as config
Jul 25 14:40:03 linpubn218.gl.avaya.com yum[29309]: Installed: postgresql84-server-8.4.17-1PGDG.rhel6.x86_64
Jul 25 14:42:05 linpubn218.gl.avaya.com polkitd[819]: Registered Authentication Agent for unix-process:29459:43987285 (system bus name :1.292 [/usr/bin/pkttyagent --not
Jul 25 14:42:05 linpubn218.gl.avaya.com systemd[1]: Starting SYSV: PostgreSQL database server....
Jul 25 14:42:06 linpubn218.gl.avaya.com runuser[29473]: pam_unix(runuser-l:session): session closed for user postgres
Jul 25 14:42:08 linpubn218.gl.avaya.com postgresql[29464]: Starting postgresql service: [  OK  ]
Jul 25 14:42:08 linpubn218.gl.avaya.com systemd[1]: PID file /var/run/postmaster-8.4.pid not readable (yet?) after start.
Jul 25 14:42:08 linpubn218.gl.avaya.com systemd[1]: Failed to start SYSV: PostgreSQL database server..

Can postgresql 8.4 be installed on RHEL7, which is a systemd based OS? If yes, then what should I do to remove the above error?

2
  • Just in case, are you running v8.4 in a different port that v9.2? Commented Jul 25, 2016 at 9:30
  • I have uninstalled all the postgresql instances from my new system having RHEL7. After that, I tried to freshly install postgresql 8.4 which is using default port 5432 Commented Jul 25, 2016 at 9:40

2 Answers 2

1

I noticed that in /etc/init.d/postgresql-8.4 there is a declared variable:

pidfile="/var/run/postmaster-${PGMAJORVERSION}.${PGPORT}.pid"

But in systemctl, PIDfile is not the same:

# systemctl show postgresql-8.4.service -p PIDFile PIDFile=/var/run/postmaster-8.4.pid

So, to fix the problem edit /etc/init.d/postgresql-8.4 and replace

pidfile="/var/run/postmaster-${PGMAJORVERSION}.${PGPORT}.pid"

with

pidfile="/var/run/postmaster-${PGMAJORVERSION}.pid"

then reload systemctl:

# systemctl daemon-reload
#/etc/init.d/postgresql-8.4 start
Starting postgresql-8.4 (via systemctl):                   [  OK  ]
Sign up to request clarification or add additional context in comments.

Comments

0

Generally permissions caused this type of error

su - postgres

After that:

chmod 700 -R <data_directory>

And you should check SELinux as well.

3 Comments

I checked with the permissions(700) and SELinux status (disabled). Still, it is not working for me. I didnt get which resource this line is pointing to: Job for postgresql-8.4.service failed because a configured resource limit was exceeded. And other logs says PID file /var/run/postmaster-8.4.pid not readable (yet?) after start. I cannot see any var/run/postmaster-8.4.pid file. Though two other files named postmaster-8.4.5432.pid and postmaster.7654.pid are present. Can postgresql 8.4 be really installed on RHEL7?
did you try yum install libstdc++.i686 i ready some people solved their issue with this lib
libstdc++.x86_64 is already installed. I updated this package but no luck. Same issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.