I just started using PostgreSQL 9.5 and facing some problem with starting the DB service on RHEL6. I get the following error while trying to start the PostgreSQL service:

Code:
could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": Permission denied
I am not allowed to change any permissions under /var folder, so I wanted the lock file to be created under the /tmp directory instead. So I changed my Dbstart script and in postgresql.conf file, I changed:

Code:
#unix_socket_directories = '/var/run/postgresql, /tmp'
to

Code:
unix_socket_directories = '/tmp'
after initdb. Now the PostgreSQL service starts without any error however when i try to connect to the DB and create a DB or run any query, it gives me an error:
Code:
psql: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I thought I already changed the unix_socket_directories to /tmp but it is still trying to create a lock file under /var/run/postgres .
Can someone please suggest how to create the socket and the PG locks under /tmp dir and not /var/run ?

Thanks.