Don't see the folder

Hi,
I have already set up
postgresql-server-8.4.20-1.el6_5.x86_64

on Linux Redhat, but I do not see this folder

/usr/local/pgsql

why?
LVL 11
HuaMin ChenProblem resolverAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

duncanb7Commented:
Is it at /var/lib/pgsql ?
Please take a look this link, the variable setting is set to /var/lib/pgsql
https://wiki.postgresql.org/wiki/PostgreSQL_on_RedHat_Linux

Duncan
0
HuaMin ChenProblem resolverAuthor Commented:
Sorry, I get this

[huamin@CentOS65x64 lib]$ cd /var/lib
[huamin@CentOS65x64 lib]$ postgres
postgres does not know where to find the server configuration file.
You must specify the --config-file or -D invocation option or set the PGDATA environment variable.
[huamin@CentOS65x64 lib]$ 

Open in new window

0
duncanb7Commented:
Is there any file or directory in /var/lib/ ? If so, it proved you did installation before
Supposed the installation will do setup for you so you don't need to do environment setup

just run

service postgresql start

you can take sometime to review the link in previous post

Duncan
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

HuaMin ChenProblem resolverAuthor Commented:
Sorry, I still get this
[root@CentOS65x64 huamin]# service postgresql start
Starting postgresql service:                               [  OK  ]
[root@CentOS65x64 huamin]# exit
exit
[huamin@CentOS65x64 ~]$ postgres -D /var/lib/pgsql/data
postgres cannot access the server configuration file "/var/lib/pgsql/data/postgresql.conf": Permission denied
[huamin@CentOS65x64 ~]$ 

Open in new window

0
duncanb7Commented:
In the link posted previously, for older version linux
Please try it again
----------------------------------------
chkconfig postgresql on
service postgresql start

What is Linux version?

Duncan
0
HuaMin ChenProblem resolverAuthor Commented:
Many thanks. This is in CentOS 6.5.

i still get this
[root@CentOS65x64 huamin]# chkconfig postgresql on
[root@CentOS65x64 huamin]# service postgresql start
Starting postgresql service:                               [  OK  ]
[root@CentOS65x64 huamin]# exit
exit
[huamin@CentOS65x64 ~]$ postgres -D /var/lib/pgsql/data
postgres cannot access the server configuration file "/var/lib/pgsql/data/postgresql.conf": Permission denied
[huamin@CentOS65x64 ~]$ 

Open in new window

0
duncanb7Commented:
Take a look at this article
http://blog.endpoint.com/2009/09/permission-denied-for-postgresqlconf.html

about  "postgres cannot access the server configuration file "/var/lib/pgsql/data/postgresql.conf": Permission denied"


Duncan
0
HuaMin ChenProblem resolverAuthor Commented:
Sorry, I get this
[root@CentOS65x64 huamin]# service postgresql start
Starting postgresql service:                               [  OK  ]
[root@CentOS65x64 huamin]# exit
exit
[huamin@CentOS65x64 ~]$ postgres -D /usr/local/pgsql/data
postgres cannot access the server configuration file "/usr/local/pgsql/data/postgresql.conf": No such file or directory

Open in new window

I don't know how to create "postgresql.conf".
0
duncanb7Commented:
Take a look at this link to explain the process for postresql
http://www.kelvinwong.ca/tag/postgresql-conf/

Is there any postgresql.conf, conf file at /var/lib/pgsql/data/ ?

Duncan
0
duncanb7Commented:
(in the first post) editing /etc/sysconfig/pgsql/postgresql and check this out

PGDATA=/var/lib/pgsql/data
PGPORT=5432
PGLOG=/var/lib/pgsql/pgstartup.log
PGOPTS=


Duncan
0
HuaMin ChenProblem resolverAuthor Commented:
Many thanks.
It means huamin user below, is not able to access the folder,

[huamin@CentOS65x64 ~]$ cd /var/lib/pgsql/data/
bash: cd: /var/lib/pgsql/data/: Permission denied
[huamin@CentOS65x64 ~]$ su
Password: 
[root@CentOS65x64 huamin]# cd /var/lib/pgsql/data/
[root@CentOS65x64 data]# 

Open in new window

then which privileges should be added to "huamin"?
0
HuaMin ChenProblem resolverAuthor Commented:
what to adjust then?
Hi,
I've edited this file
/etc/sysconfig/pgsql/postgresql

but I still get this
[root@CentOS65x64 huamin]# service postgresql start
Starting postgresql service:                               [  OK  ]
[root@CentOS65x64 huamin]# exit
exit
[huamin@CentOS65x64 ~]$ postgres -D /var/lib/pgsql/data
postgres cannot access the server configuration file "/var/lib/pgsql/data/postgresql.conf": Permission denied

Open in new window

0
earth man2Commented:
use postgres user account rather than change file privielges
ie
as root
su - postgres
postgres -D /var/lib/pgsql/data
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HuaMin ChenProblem resolverAuthor Commented:
Many thanks. Any advice to these?

[root@CentOS65x64 huamin]# su - postgres
su: warning: cannot change directory to /var/lib/pgsql: Permission denied
-bash: /var/lib/pgsql/.bash_profile: Permission denied
-bash-4.1$ postgres -D /var/lib/pgsql/data
postgres cannot access the server configuration file "/var/lib/pgsql/data/postgresql.conf": Permission denied
-bash-4.1$ 

Open in new window

0
earth man2Commented:
Your installation is messed up.
Try this for starters as root, until user postgres can logon nothing will work as intended

chown -r postgres /var/lib/pgsql

Open in new window

0
HuaMin ChenProblem resolverAuthor Commented:
Sorry, please advise to this

[root@CentOS65x64 huamin]# chown -r postgres /var/lib/pgsql
chown: invalid option -- 'r'
Try `chown --help' for more information.
[root@CentOS65x64 huamin]# 

Open in new window

0
earth man2Commented:
-R
0
earth man2Commented:
Set password for user postgres if you haven't done so already as root
passwd postgres

Then logon as postgres.  Were you successful?

Then consider if SELinux is the problem
http://docs.fedoraproject.org/en-US/Fedora/13/html/Managing_Confined_Services/sect-Managing_Confined_Services-PostgreSQL-Configuration_Examples.html
0
HuaMin ChenProblem resolverAuthor Commented:
Thanks a lot.
I've already successfully changed the password of user "postgres" and then what to check next?
0
earth man2Commented:
logon as postgres.  Were you successful?
0
HuaMin ChenProblem resolverAuthor Commented:
Sorry Earthman.

I was confused to this as other people told me that it is suggested not to log into a service account, in this
http://www.experts-exchange.com/Database/PostgreSQL/Q_28479805.html#a40208103
0
earth man2Commented:
The postgres account is used to administrate the database.  Eg set up database roles and table access privileges.  If you need to set logon restrictions then you would only allow logon if sat at the server console.
0
HuaMin ChenProblem resolverAuthor Commented:
Sorry, how to resolve this error attached, when logging into the OS using postgres account?
t763.png
0
HuaMin ChenProblem resolverAuthor Commented:
Please omit the last post above.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PostgreSQL

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.