From owner-freebsd-questions@FreeBSD.ORG Thu Sep 15 09:10:28 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 B15FD16A421 for ; Thu, 15 Sep 2005 09:10:28 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from smtp-out4.blueyonder.co.uk (smtp-out4.blueyonder.co.uk [195.188.213.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id E0D6843D5A for ; Thu, 15 Sep 2005 09:10:25 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from [80.192.58.55] ([80.192.58.55]) by smtp-out4.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.6713); Thu, 15 Sep 2005 10:11:13 +0100 Message-ID: <43293A7F.9050607@dial.pipex.com> Date: Thu, 15 Sep 2005 10:10:23 +0100 From: Alex Zbyslaw User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-GB; rv:1.7.11) Gecko/20050903 X-Accept-Language: en-us, pl MIME-Version: 1.0 To: Dave Webster References: <1126765442.5238.13.camel@localhost> In-Reply-To: <1126765442.5238.13.camel@localhost> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 15 Sep 2005 09:11:13.0311 (UTC) FILETIME=[6B8702F0:01C5B9D5] Cc: FreeBSD questions Subject: Re: can't run /sbin commands 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: Thu, 15 Sep 2005 09:10:28 -0000 Dave Webster wrote: >When I first installed FreeBSD I was able to run "halt" and "reboot" as >su without the full /sbin/reboot command. After adding a new path to >PATH, I've been unable to run these commands without specifying the full >path. >[...] >Here is the output of echo $PATH: >/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin: >/usr/X11R6/bin:/home/Dave/bin:/usr/home/Dave/apache-forrest-0.7/bin > >My question is with /sbin in the path why do I have to >specify /sbin/reboot, /sbin/kldstat etc.? Could this be causing my make >install to fail? How can /sbin be in the path and still require a full >path declaration for it's commands to work. > > The short answer to your question is that if /sbin really were in your path you would be able to run programs from it, therefore /sbin is *not* in your path. (Since you can run commands from /sbin with full path names it can't be file permissions or deleted programs). Either that or something else on you path is somehow messing up your shell big-time, but that seems less likely. You say that the problems started after you changed you path (I assume in your .profile or whatever). So, quite simply, you must have made some kind of mistake. I would suggest going back to the file you edited and starting again. Comment out the PATH specification and add things back one at a time. Assuming a /bin/sh or derivative, you can re-load your file with . filename (for csh derivatives, use "source filename"). After each change you make, source the changes and see if you can run some innocuous program from /sbin such as kldstat. --Alex