From owner-freebsd-questions@FreeBSD.ORG Mon May 28 21:06:45 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEF1D1065806 for ; Mon, 28 May 2012 21:06:44 +0000 (UTC) (envelope-from bonomi@mail.r-bonomi.com) Received: from mail.r-bonomi.com (mx-out.r-bonomi.com [204.87.227.120]) by mx1.freebsd.org (Postfix) with ESMTP id 1427B8FC19 for ; Mon, 28 May 2012 21:06:43 +0000 (UTC) Received: (from bonomi@localhost) by mail.r-bonomi.com (8.14.4/rdb1) id q4SL8fqJ090973 for freebsd-questions@freebsd.org; Mon, 28 May 2012 16:08:41 -0500 (CDT) Date: Mon, 28 May 2012 16:08:41 -0500 (CDT) From: Robert Bonomi Message-Id: <201205282108.q4SL8fqJ090973@mail.r-bonomi.com> To: freebsd-questions@freebsd.org In-Reply-To: <4FC3CC89.1000504@dreamchaser.org> Subject: Re: removing /var/empty on a non-system disk X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2012 21:06:45 -0000 h > From owner-freebsd-questions@freebsd.org Mon May 28 14:10:55 2012 > Date: Mon, 28 May 2012 13:05:45 -0600 > From: Gary Aitken > To: Polytropon > Cc: freebsd-questions@freebsd.org > Subject: Re: removing /var/empty on a non-system disk > > On 5/25/2012 4:01 PM, Polytropon wrote: > > > > I should have mentioned that I did the (successful) test > > logging in as root (real console login). If you use "su -" > > or "su root", the effect should be the same. You can always > > check the success of your operation with the "ls -lo" command. > > Nope. That was the problem. I had logged in on the vty as normal user > and done su root. Had to back all the way out and log in on the vty as > root to make it work. I'm going to guess that you did 'su root', not 'su - root'. The two commands are *NOT* identical. 'su root' does not run the root 'login' scripts; thus environment variables (including path, user, logname etc.) are *not* set as they are on root login -- this causes some 'am i root' tests to fail. OTOH, 'su - root' should be equivalent to a root login in all respects. NOTE; there will be issues if the 'working directory' of a parent process is the directory you are trying to delete.