Re: ipcclean in 8.1 broken?

From: Roman Neuhauser <neuhauser(at)sigpipe(dot)cz>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Subject: Re: ipcclean in 8.1 broken?
Date: 2006-03-01 12:04:11
Message-ID: 20060301120411.GA96175@isis.sigpipe.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

# peter_e(at)gmx(dot)net / 2006-03-01 12:49:13 +0100:
> Am Dienstag, 28. Februar 2006 07:42 schrieb Christopher Kings-Lynne:
> > I just tried using ipcclean in 8.1.3. It doesn't work when I su to the
> > pgsql user. This part of the script:
> >
> > if [ "$USER" = 'root' -o "$LOGNAME" = 'root' ]
> >
> > Always fails because even tho $USER is set to 'pgsql' when su'ed,
> > $LOGNAME is still root.
> >
> > This is on FreeBSD 4.9
>
> It seems to work on Linux; apparently there are different behaviors of su. Do
> you have a suggestion for resolving this?

use "su -l"? this is on FreeBSD 6:

By default, the environment is unmodified with the exception of USER,
HOME, and SHELL.
...
-l Simulate a full login. The environment is discarded except for
HOME, SHELL, PATH, TERM, and USER. HOME and SHELL are modified
as above. USER is set to the target login. PATH is set to
``/bin:/usr/bin''. TERM is imported from your current environ-
ment.

smradoch(at)neuhauser ~ 1001:0 > echo $USER $LOGNAME
smradoch smradoch
smradoch(at)neuhauser ~ 1002:0 > su -l
Password:
neuhauser# echo $USER $LOGNAME
root root
neuhauser# logout
smradoch(at)neuhauser ~ 1003:0 > su
Password:
You have mail.
neuhauser# echo $USER $LOGNAME
smradoch smradoch
neuhauser# exit
smradoch(at)neuhauser ~ 1004:0 > uname -srm
FreeBSD 6.1-PRERELEASE amd64

su (coreutils) 4.5.3 on RHEL3 behaves exactly the same.

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message sandhya 2006-03-01 12:18:51 Reg:lo_open error..pls help me
Previous Message PFC 2006-03-01 11:58:21 Re: wal sync method