From owner-freebsd-questions Sat Jan 4 11:31:36 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7D9BB37B405 for ; Sat, 4 Jan 2003 11:31:34 -0800 (PST) Received: from sub21-156.member.dsl-only.net (sub21-156.member.dsl-only.net [63.105.21.156]) by mx1.FreeBSD.org (Postfix) with ESMTP id 04AAF43EDC for ; Sat, 4 Jan 2003 11:31:34 -0800 (PST) (envelope-from nkinkade@sub21-156.member.dsl-only.net) Received: from nkinkade by sub21-156.member.dsl-only.net with local (Exim 4.10) id 18Uu12-000KOr-00 for freebsd-questions@freebsd.org; Sat, 04 Jan 2003 11:31:28 -0800 Date: Sat, 4 Jan 2003 11:31:28 -0800 From: Nathan Kinkade To: freebsd-questions@freebsd.org Subject: Re: Not a bug? Message-ID: <20030104193128.GL65686@sub21-156.member.dsl-only.net> Reply-To: nkinkade@dsl-only.net Mail-Followup-To: freebsd-questions@freebsd.org References: <200301041859.H04IXJS65145@asarian-host.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200301041859.H04IXJS65145@asarian-host.net> User-Agent: Mutt/1.4i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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