LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-09-2015, 03:39 AM   #1
hotspur919
LQ Newbie
 
Registered: Jan 2011
Location: Glasgow, UK
Distribution: RHEL, mint
Posts: 25

Rep: Reputation: 0
postgreSQL service start issues (RHEL6.7)


Hi,

I am seeing something odd when trying to start up the postgresql service (for the first time) on my RHEL6.7 box. When I try to start it using either
Code:
service postgresql start
or
Code:
/etc/init.d/postgresql start
, it fails.

In an attempt to find out what was failing in the script I ran
Code:
bash -x /etc/init.d/postgresql start
, and it worked! WTF? I am at a loss as to how this would make a difference, but it does. I can then stop the service normally, but then cannot start again unless I use bash -x...

Does anyone know why this would be? Obviously starting up postgres like this is not a solution.....

Oh, nearly forgot...When starting without bash -x I get the following (not verbatim) in my pgstartup.log:

postmaster is unable to open /home/pgsql/data/postgresql.conf: permission denied. I checked permissions and all look ok and of course postmaster has no problems reading this file when running the service with bash -x.....???



Thanks!
 
Old 10-12-2015, 09:53 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
When you run bash it is spawning subshell then executing the commands in the script as an argument.

Have you checked the permissions on the init script itself to make sure it is executable? If it isn't that might explain why a run with bash being executed with the script as an argument works but it doesn't work if run within the current shell.
 
Old 11-01-2015, 04:29 PM   #3
hotspur919
LQ Newbie
 
Registered: Jan 2011
Location: Glasgow, UK
Distribution: RHEL, mint
Posts: 25

Original Poster
Rep: Reputation: 0
Sorry for the late response, I have figured my problem out (with some help). I installed postgres in a non-standard location (not /var/lib/pgsql) and so SELlinux would not allow postgres to start from my new location. After I created a policy for the new location it runs fine.

I still have no idea why running the postgresql init script from a new bash subshell worked, but just calling the script by running /etc/init.d/postgresql start did not... I'd love to know why. Permissions were fine since as soon as I added the SElinux policy, postgres started...

Does anyone have any ideas why I could start postgres like this:

bash /etc/init.d/postgresql start

but not like this:

/etc/init.d/postgresql start

??


Thanks

Last edited by hotspur919; 11-01-2015 at 04:43 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to start PostgreSQL service on suse linux SP4 10 sandeep002gupta SUSE / openSUSE 9 07-16-2014 01:58 PM
postgresql service start error LiQu Linux - Newbie 3 06-02-2013 08:32 AM
[SOLVED] Cannot Start Postgresql Service in RHEL 6 griffey Red Hat 2 05-18-2012 06:38 AM
[SOLVED] Postgresql service does not start when boot thach.trung.ngoc Slackware 2 03-26-2012 06:00 AM
postgresql service failed to start or stop purohit.mayur Linux - Newbie 5 01-07-2010 03:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration