Skip site navigation (1) Skip section navigation (2)

Re: changing user id

From: Russell Davie <rjrd(at)exemail(dot)com(dot)au>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: changing user id
Date: 2006-05-30 09:19:30
Message-ID: 20060530191930.7273449f@localhost.localdomain (view raw or flat)
Thread:
Lists: pgsql-novice
On Tue, 30 May 2006 06:30:34 +0100
Mark Kelly <pgsql(at)wastedtimes(dot)net> wrote:

> On Tuesday 30 May 2006 03:57, Tom Lane wrote:
> > Russell Davie <rjrd(at)exemail(dot)com(dot)au> writes:
> 
> > > hope this is the right list to ask this question...
> 
> You might have been better off on the Ubuntu list, but it's one of those 
> questions that could go either way :)
> 
> Here it is, in case you want to join up:
> http://www.ubuntu.com/community/lists

thanks, have done so 


> 
> > > postgres(at)XXXXX:~$ /etc/init.d/postgresql-7.4 start
> > > chmod: changing permissions of `/var/run/postgresql': Operation not
> > > permitted * Starting PostgreSQL 7.4 database server:main
> > > Error: Could not change user id                                    
> > > [fail]
> >
> > init scripts generally expect to be launched as root.  Perhaps
> >  sudo /etc/init.d/postgresql-7.4 start
> 
> That should fix the error above, as long as you run it from a user account 
> that is in the sudoers file (which the user postgres isn't on Ubuntu). Your 
> main user account will be.

PostgreSQL will not start for root user in Ubuntu or for a user who is listed in sudoers file

as root or as a sudoer:
XXX(at)XXXX:~$ sudo /etc/init.d/postgresql-7.4 start
 * Starting PostgreSQL 7.4 database server:main
pg_ctl: cannot be run as root
Please log in (using, e.g., "su") as the (unprivileged) user that will
own the server process.					[fail]

> > would work better.  Actually, I believe that on modern systems
> > you're not really supposed to invoke an init script directly like
> > that at all, but instead through the "service" program;  
> "service" is not part of the vanilla Ubuntu install (I've only seen it on 
> redhat-based systems). The first suggestion you made is the right one for 
> Ubuntu.

The "service" is a feature of Red Hat based Linux distributions and not used by Ubuntu, which is based on Debian which uses a different way to start processes.
This script is what is started at boot up, and here I have done it at CLI to show the output of what happens at boot.

- Russell




In response to

pgsql-novice by date

Next:From: Verena RuffDate: 2006-05-30 15:15:32
Subject: SQL or table design optimation
Previous:From: Mark KellyDate: 2006-05-30 05:30:34
Subject: Re: changing user id

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group