pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedError: Could not change user id
5+ messages / 3 participants
[nested] [flat]
* Error: Could not change user id
@ 2006-05-28 23:31 Russell Davie <rjrd@exemail.com.au>
2006-05-29 00:59 ` Re: Error: Could not change user id Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 5+ messages in thread
From: Russell Davie @ 2006-05-28 23:31 UTC (permalink / raw)
To: pgsql-admin
Hi All
I have used PostgreSQL for SQL-Ledger in Linux (Ubuntu) for about 6months and have run into PostgreSQL
problems when it starts up.
PostgreSQL is reporting errors about changing user id so that it falls
over when the system boots.
I've read this:
http://archives.postgresql.org/pgsql-admin/2006-01/msg00273.php
I have found FAQ for Linux:
http://www.designmagick.com/article/2/Starting-Out/Installing-PostgreSQL
yet this error still occurs after changing the permissions of the postgresql directory
ie:
sudo chown -R postgres:postgres /usr/share/postgresql
sudo chown -R postgres:postgres /usr/share/postgresql-common
what happens:
Manually starting postgresql by the user postgres:
postgres@XXXX:/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]
after changing ownership of `/var/run/postgresql' to postgres:postgres and with
permissions 4777 then the errors are less, but postgresql still doesn't
start:
postgres@XXX:/etc/init.d$ ./postgresql-7.4 start
* Starting PostgreSQL 7.4 database server:main
Error: Could not change user id [fail]
I think this maybe something in /etc/postgresql/7.4/pg_hba.log or /etc/postgresql/7.4/postgresql.conf yet I haven't found the solution to get PostgreQL going.
What could be wrong here?
How can this be fixed?
What do I need to read?
TIA
Russell
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Error: Could not change user id
2006-05-28 23:31 Error: Could not change user id Russell Davie <rjrd@exemail.com.au>
@ 2006-05-29 00:59 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-05-29 04:25 ` Re: Error: Could not change user id Russell Davie <rjrd@exemail.com.au>
0 siblings, 1 reply; 5+ messages in thread
From: Tom Lane @ 2006-05-29 00:59 UTC (permalink / raw)
To: Russell Davie <rjrd@exemail.com.au>; +Cc: pgsql-admin
Russell Davie <rjrd@exemail.com.au> writes:
> Manually starting postgresql by the user postgres:
> postgres@XXXX:/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]
There is no such error message anywhere in the PG 7.4 source code.
I suppose it's coming out of whatever init script you're using;
have you tried reading the init script for enlightenment?
(FWIW, init scripts are almost always designed to be executed as
root, not as random unprivileged users like postgres. sudo might
help.)
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Error: Could not change user id
2006-05-28 23:31 Error: Could not change user id Russell Davie <rjrd@exemail.com.au>
2006-05-29 00:59 ` Re: Error: Could not change user id Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-05-29 04:25 ` Russell Davie <rjrd@exemail.com.au>
2006-05-29 04:57 ` Re: Error: Could not change user id Tim Allen <tim@proximity.com.au>
0 siblings, 1 reply; 5+ messages in thread
From: Russell Davie @ 2006-05-29 04:25 UTC (permalink / raw)
To: pgsql-admin
On Sun, 28 May 2006 20:59:33 -0400
Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Russell Davie <rjrd@exemail.com.au> writes:
> > Manually starting postgresql by the user postgres:
> > postgres@XXXX:/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]
>
> There is no such error message anywhere in the PG 7.4 source code.
> I suppose it's coming out of whatever init script you're using;
> have you tried reading the init script for enlightenment?
>
Interesting! I never thought it could be the window manager.
This is still occurring using Metacity and it still happened in Enlightnement and WindowMaker and also at CLI without any window-manager at all!
> (FWIW, init scripts are almost always designed to be executed as
> root, not as random unprivileged users like postgres. sudo might
> help.)
>
> regards, tom lane
postgresql doesn't like been stared as root:
f
XX@XXXX:/etc/init.d$ sudo ./postgresql-7.4 start
Password:
* 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.
The PostgreSQL server failed to start. Please check the log output: [fail]
On doing a search on the disk using the terms: "Could not change user id"
located this in in line 467 of /usr/share/postgresql-common/PgCommon.pm
It seems this is checking the group and user of the process which suggests not getting settings correct.
Maybe this could help in showing where to correct this issue?
[CODE]
# Change effective and real user and group id. If the user id is member of the
# "shadow" group, then "shadow" will be in the set of effective groups. Exits
# with an error message if user/group ID cannot be changed.
# Arguments: <user id> <group id>
sub change_ugid {
my ($uid, $gid) = @_;
my $groups = $gid;
$groups .= " $groups"; # first additional group
# check whether owner is in the shadow group, and keep shadow privileges in
# this case; this is a poor workaround for the lack of initgroups().
my @shadowmembers = split /\s+/, ((getgrnam 'shadow')[3]);
for my $m (@shadowmembers) {
my $mid = getpwnam $m;
if ($mid == $uid) {
$groups .= ' ' . (getgrnam 'shadow');
last;
}
}
$( = $) = $groups;
$< = $> = $uid;
error 'Could not change user id' if $< != $uid;
error 'Could not change group id' if $( != $gid;
}
[/CODE]
regards
Russell
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Error: Could not change user id
2006-05-28 23:31 Error: Could not change user id Russell Davie <rjrd@exemail.com.au>
2006-05-29 00:59 ` Re: Error: Could not change user id Tom Lane <tgl@sss.pgh.pa.us>
2006-05-29 04:25 ` Re: Error: Could not change user id Russell Davie <rjrd@exemail.com.au>
@ 2006-05-29 04:57 ` Tim Allen <tim@proximity.com.au>
2006-05-29 05:45 ` Re: Error: Could not change user id Russell Davie <rjrd@exemail.com.au>
0 siblings, 1 reply; 5+ messages in thread
From: Tim Allen @ 2006-05-29 04:57 UTC (permalink / raw)
To: Russell Davie <rjrd@exemail.com.au>; +Cc: pgsql-admin
Russell Davie wrote:
> On Sun, 28 May 2006 20:59:33 -0400 Tom Lane <tgl@sss.pgh.pa.us>
> wrote:
>> There is no such error message anywhere in the PG 7.4 source code.
>> I suppose it's coming out of whatever init script you're using;
>> have you tried reading the init script for enlightenment?
> Interesting! I never thought it could be the window manager. This is
> still occurring using Metacity and it still happened in Enlightnement
> and WindowMaker and also at CLI without any window-manager at all!
I'm quite sure that Tom was referring to enlightenment in the general
sense of the word, ie some init script (eg the one for the postgresql
service) might enlighten you as to what is going on! :-)
Tim
--
-----------------------------------------------
Tim Allen tim@proximity.com.au
Proximity Pty Ltd http://www.proximity.com.au/
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Error: Could not change user id
2006-05-28 23:31 Error: Could not change user id Russell Davie <rjrd@exemail.com.au>
2006-05-29 00:59 ` Re: Error: Could not change user id Tom Lane <tgl@sss.pgh.pa.us>
2006-05-29 04:25 ` Re: Error: Could not change user id Russell Davie <rjrd@exemail.com.au>
2006-05-29 04:57 ` Re: Error: Could not change user id Tim Allen <tim@proximity.com.au>
@ 2006-05-29 05:45 ` Russell Davie <rjrd@exemail.com.au>
0 siblings, 0 replies; 5+ messages in thread
From: Russell Davie @ 2006-05-29 05:45 UTC (permalink / raw)
To: pgsql-admin
On Mon, 29 May 2006 14:57:15 +1000
Tim Allen <tim@proximity.com.au> wrote:
> Russell Davie wrote:
> > On Sun, 28 May 2006 20:59:33 -0400 Tom Lane <tgl@sss.pgh.pa.us>
> > wrote:
> >> There is no such error message anywhere in the PG 7.4 source code.
> >> I suppose it's coming out of whatever init script you're using;
> >> have you tried reading the init script for enlightenment?
>
> > Interesting! I never thought it could be the window manager. This is
> > still occurring using Metacity and it still happened in Enlightnement
> > and WindowMaker and also at CLI without any window-manager at all!
>
> I'm quite sure that Tom was referring to enlightenment in the general
> sense of the word, ie some init script (eg the one for the postgresql
> service) might enlighten you as to what is going on! :-)
thanks for that! <doh>
I *was* wondering what he meant and found the error message in start-up script /usr/share/postgresql-common/PgCommon.pm
Reading the script suggests that the user to be a member of the "shadow" group, which is now done.
However, postgresql is still not starting and produces the same errors:
postgres@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]
Are there special privileges that the "shadow" group has?
What is eluding me is decyphering it into practical steps to getting postgresql working again.
TIA
Rusell
>
> Tim
>
> --
> -----------------------------------------------
> Tim Allen tim@proximity.com.au
> Proximity Pty Ltd http://www.proximity.com.au/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2006-05-29 05:45 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-05-28 23:31 Error: Could not change user id Russell Davie <rjrd@exemail.com.au>
2006-05-29 00:59 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-05-29 04:25 ` Russell Davie <rjrd@exemail.com.au>
2006-05-29 04:57 ` Tim Allen <tim@proximity.com.au>
2006-05-29 05:45 ` Russell Davie <rjrd@exemail.com.au>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox