LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   shutdown RH 8 (https://www.linuxquestions.org/questions/linux-general-1/shutdown-rh-8-a-49396/)

juanb 03-12-2003 02:47 AM

shutdown RH 8
 
I usually logged as a regular user. whan I want to shotdown the system I know I must su to root an than enter the command shutdown or init but whan I do that I recive command not fownd.

why?

Silent Bob 03-12-2003 03:58 AM

shutdown is located in /sbin/ which isn't in a normal users $PATH. If you just run su it doesn't create a login shell so you don't get that users environment settings etc.

Short answer - if you use su you will have to run /sbin/shutdown

Otherwise run su - (that's su followed by a dash) and that makes it a login shell and you can run shutdown without having to specify it's path.

mayankjohri 03-12-2003 03:58 AM

because when you su to root the root profile file is not executed. first execute the profile file and this problem will fly away
#. /root/.bash_profile

mayankjohri 03-12-2003 04:01 AM

silent bob gave the correct answer.
Cheers for Silent BOB

nakkaya 03-12-2003 01:09 PM

if you chmod 7755 /sbin/shutdown you can shutdown the machine as regular user

Silent Bob 03-12-2003 02:37 PM

Quote:

Originally posted by nakkaya
if you chmod 7755 /sbin/shutdown you can shutdown the machine as regular user
True. But then ANY user logged in to your machine can shut it down...

xzh2001 03-13-2003 10:54 PM

Quote:

Originally posted by Silent Bob
True. But then ANY user logged in to your machine can shut it down...
how i can do that?

Crashed_Again 03-13-2003 11:03 PM

How can you do what? Allow all users to be able to shutdown? nakkaya told us how to do it.

chrisk5527 03-15-2003 10:50 AM

If you use the "su - root" it will load root's PATH and then you can just issue your shutdown command.


All times are GMT -5. The time now is 08:37 PM.