Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Jan 2003 11:31:28 -0800
From:      Nathan Kinkade <nkinkade@dsl-only.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: Not a bug?
Message-ID:  <20030104193128.GL65686@sub21-156.member.dsl-only.net>
In-Reply-To: <200301041859.H04IXJS65145@asarian-host.net>
References:  <200301041859.H04IXJS65145@asarian-host.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jan 04, 2003 at 07:59:16PM +0100, Mark wrote:
> I will not call this a "bug", because usually when people cry bug they just
> mean they did not understand a certain behavior. :)
> 
> Still, when I "su -l" to root from, say, the user "maintenance", and then
> issue a "shutdown -p now", the shutdown message sent around does not appear
> to come from "root", but from the underlying "maintenance" user:
> 
> ----------------------------
> shutdown: [pid 4184]
> asarian-host: {root} %
> *** FINAL System shutdown message from maintenance@asarian-host.net ***
> System going down IMMEDIATELY
> ----------------------------
> 
> (Uh-oh, there goes my uptime!) Should it be an anomaly, it would certainly
> be one I can live with. :) For the sake of curiosity, though, why is the
> shutdown message not being broadcasted from "root" in this case?
> 
> Thanks,
> 
> - Mark

I think this is normal behaviour.  From the su manpage:

"DESCRIPTION
...
USER is set to the target login, unless the target login has a
user ID of 0."

Also, there are several utilities that I'm aware of which tell you to
make certain to specify the user if you have su'd.....such as crontab.  
From the crontab man page:
"Note that su(1) can confuse crontab and that if you are running inside of
su(1) you should always use the -u option for safety's sake."

Maybe someone else can explain exactly why this happens, but it seem to
be expected behaviour.

Nathan


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030104193128.GL65686>