Date: Thu, 15 Sep 2005 10:10:23 +0100 From: Alex Zbyslaw <xfb52@dial.pipex.com> To: Dave Webster <dwebman@telus.net> Cc: FreeBSD questions <freebsd-questions@freebsd.org> Subject: Re: can't run /sbin commands Message-ID: <43293A7F.9050607@dial.pipex.com> In-Reply-To: <1126765442.5238.13.camel@localhost> References: <1126765442.5238.13.camel@localhost>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43293A7F.9050607>