Re: How to startup the database server? - Mailing list pgsql-general

From Adrian Klaver
Subject Re: How to startup the database server?
Date
Msg-id CANf5jyN5yS-5hYM1zzBgv16BkTReSWDihTNUf_ZptJ_ZA3D8=g@mail.gmail.com
Whole thread Raw
In response to Re: How to startup the database server?  (Jason Ma <rosegun38@gmail.com>)
List pgsql-general


On Wed, Dec 19, 2012 at 7:34 AM, Jason Ma <rosegun38@gmail.com> wrote:
Hi,
   The ps output is after the server start, I don't know why I can't see any process after start the server. And of course I use root to initial db, 'cause we have to run this command in CentOS  which you need the privilege of root.

Well yes and no. If you run the service command you need to run as root. If you become the Postgres user you can run the initdb command directly as that user. The same goes for starting.

Did you try ps -ef | grep post ?

As a test try the following:

service postgresql stop

su - to the postgres user 

do:

 /usr/bin/pg_ctl -D /var/lib/pgsql/data  start

Note no log file. This should output to the terminal.
Report what it says.

Also check the system log to see if there is something else preventing Postgres start. Hint, SELinux.


 

service postgresql start

Regards,
Jason


2012/12/19 Adrian Klaver <adrian.klaver@gmail.com>
On 12/19/2012 07:07 AM, Jason Ma wrote:
Thanks, adrian,  but I have check the pgstartup.log, I got the following
messages:
.....
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok

Success. You can now start the database server using:

     /usr/bin/postgres -D /var/lib/pgsql/data
or
     /usr/bin/pg_ctl -D /var/lib/pgsql/data -l logfile start

runuser: cannot set groups: Operation not permitted

Seems the database cluster was initialized. Sort of concerned by the runuser error. What user did you run the initdb as?



I tried this:

-bash-4.1$ /usr/bin/pg_ctl -D /var/lib/pgsql/data -l logfile start
server starting

Nothing in the logfile?


-bash-4.1$ ps -ef |grep postgres
root      2904  2585  0 22:59 pts/1    00:00:00 su - postgres
postgres  2905  2904  0 22:59 pts/1    00:00:00 -bash
postgres  2946  2905  7 23:00 pts/1    00:00:00 ps -ef
postgres  2947  2905  0 23:00 pts/1    00:00:00 grep postgres

It reported that I have started the server but  that doesn't work, I
think there must be somebody has the same problem with me. Any suggestions.

I am not seeing the server running in the above. You might want to retry the ps with post as the grep expression.


Regards,
Jason



--
Adrian Klaver
adrian.klaver@gmail.com



--
Best wishes,

Jason Ma



--
Adrian Klaver
adrian.klaver@gmail.com

pgsql-general by date:

Previous
From: Steve Crawford
Date:
Subject: Re: copy from questions
Next
From: "Sahagian, David"
Date:
Subject: cannot load server.crt