To resolve the issue, modify the postgres user shell.
To modify the postgres user shell:
- Log in to the VCSA as the root user.
Note: This procedure modifies the database and the password file. Take a backup of each before proceeding to enable your ability to roll back the state of these files.
- Open the /etc/passwd file using vi.
- Locate the postgres user shell with /bin/false entry using this command:
/^postgres:
You see this postgres user entry:
postgres:x:1000:100::/opt/vmware/vpostgres/9.0:/bin/false
- Run these commands to modify the postgres user shell from /bin/false to /bin/bash:
/false
cwbash[ESC}
You see the modified postgres user entry:
postgres:x:1000:100::/opt/vmware/vpostgres/9.0:/bin/bash
- Write the modified file out and exit the editor.
- Run this command to change the log in to postgres user:
su postgres
- Run this command to start the database:
/opt/vmware/vpostgres/9.0/bin/pg_ctl start -D /storage/db/vpostgres
If the database does not start, you may see an error similar to:
<YYYY-MM-DD><time>db: pid:6334 FATAL: bogus data in lock file "/tmp/.s.PGSQL.xxxx.lock": "ÊþÀÀ"</time>
To resolve this error, move the lock file to /tmp file and then start the database.
To move the lock file to
/tmp file:
- Run this command to create new a folder:
mkdir /tmp/old
- Run this command to move /tmp/.sPGSQL.xxxx.lock to /tmp/old:
mv /tmp/.sPGSQL.xxxx.lock /tmp/old
- Run this command to start the database:
/opt/vmware/vpostgres/9.0/bin/pg_ctl start -D /storage/db/vpostgres