rcpostgresql start fails saying cannot change directory to /var/lib/pgsql: Permission Denied

  • 7013333
  • 19-Sep-2013
  • 10-Dec-2013

Environment

Novell Data Synchronizer Mobility Pack

Situation

postgresql will not start giving "Permission denied" errors

Resolution

  1. Open a terminal and type "cd /var/lib"
  2. Type "ll" to show the permissions, for pgsql it should have the owner and group as postgres postgress
  3. If it is not, type in "chown -R postgres:postgres pgsql"
  4. Start postgresql by typing "rcpostgresql start" and it should now start successfully

Cause

postgresql not starting because the ownership is incorrect on /var/lib/pgsql

Additional Information

Notes:
rcpostgresql start
Starting PostgreSQL 8.3.23 su: warning: cannot change directory to /var/lib/pgsql: Permission denied
-bash: /var/lib/pgsql/.bash_profile: Permission denied
could not change directory to "/root"
pg_ctl: could not open PID file "/var/lib/pgsql/data/postmaster.pid": Permission denied
su: warning: cannot change directory to /var/lib/pgsql: Permission denied
-bash: /var/lib/pgsql/.bash_profile: Permission denied
could not change directory to "/root"
pg_ctl: could not open PID file "/var/lib/pgsql/data/postmaster.pid": Permission denied
failed