# [EMAIL PROTECTED] / 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.

    [EMAIL PROTECTED] ~ 1001:0 > echo $USER $LOGNAME
    smradoch smradoch
    [EMAIL PROTECTED] ~ 1002:0 > su -l
    Password:
    neuhauser# echo $USER $LOGNAME
    root root
    neuhauser# logout
    [EMAIL PROTECTED] ~ 1003:0 > su   
    Password:
    You have mail.
    neuhauser# echo $USER $LOGNAME
    smradoch smradoch
    neuhauser# exit
    [EMAIL PROTECTED] ~ 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

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to