Re: Starting postmaster problem - Mailing list pgsql-admin

From Oliver Elphick
Subject Re: Starting postmaster problem
Date
Msg-id 200011012310.eA1NAjl31990@linda.lfix.co.uk
Whole thread Raw
In response to Starting postmaster problem  (Bogdan Paduraru <bpaduraru@petar.ro>)
List pgsql-admin
Bogdan Paduraru wrote:
  >Hello,
  >I installed Postgresql 7.0.2 on a Redhat Linux 6.1 and I want now to run
  >it, but it seems I have a problem.
  >I connected as root on my server.
  >After that I do :
  >$ su postgres
  >$nohup /usr/local/pgsql/data \ </dev/null >>server.log 2>>1 &
  >After the second command I get
  >bash : server.log: Permission denied
  >Can you help me?

Several things:

1. /usr/local/pgsql/data is a directory, not a command; it's not at all
   clear what you are trying to do here.  I suppose you want to run the
   postmaster:  `/usr/local/pgsql/bin/postmaster >>server.log 2>>1', but
   you need to specify some options or define some environment
   variables (see the documentation!)

2. `su postgres' will not change directory for you, so you will still
   be in the directory where you issued the su command; however you
   are now user postgres and postgres doesn't have write permission
   in the current directory.  If you use `su - postgres' you will not
   only become user postgres but you will be put in the postgres home
   directory, where you presumably will have write permission.

3. nohup does not need to be used to run the postmaster, which disconnects
   itself from the terminal.  In fact, running nohup is probably a bad
   idea, at least on Linux, because it nices the process down, which
   will slow down query processing by the backend.

  >And another thing : how can I make it to run when I start my Linux
  >server?

Define a script under /etc/rc.d (I think that's right for Red Hat).
Look at the documentation for init for a description of what happens
at boot time.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "But they that wait upon the LORD shall renew their
      strength; they shall mount up with wings as eagles;
      they shall run, and not be weary; and they shall walk,
      and not faint."            Isaiah 40:31



pgsql-admin by date:

Previous
From: "Giovanni Serrato Castillo"
Date:
Subject: Re: pg_hba.conf
Next
From: "Robin's Postgres List Archive"
Date:
Subject: Unfamiliar SQL Exceptions