LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   shutdown command (https://www.linuxquestions.org/questions/red-hat-31/shutdown-command-180415/)

xviddivxoggmp3 05-11-2004 03:55 PM

shutdown command
 
I was setting up some aliases in my .bashrc file, but the system does not recognize them.

Code:

alias sd="shutdown -h 0"
alias rb="shutdown -r 0"

The system says it doesn't recognize the shutdown command.
I can see the man pages for shutdown on the same box.
This is screwy...
Does anyone know why this would happen?

ricstirato 05-11-2004 03:59 PM

Normal users don't have shutdown in their path, so shutdown can't be found. Use /sbin/shutdown and make sure you are allowed to use it as a normal user.

xviddivxoggmp3 05-11-2004 04:04 PM

i understand how to set permissions on a file, but how would you do it on a command? is shutdown a program file? I no longer have my linux box in front of me, so i can not explore it.

Hammett 05-12-2004 06:30 AM

for reboot, you can use "reboot" (available to users) and for shutdown... is in /sbin/shutdown, but has not user permissions, so you should change it.
Can you use also "shutdown -h 0" ?? cause i always use "shutdown -h now"....are they the same?

ricstirato 05-12-2004 01:10 PM

You can configure sudo to allow all normal users (or a group or single user or ...) to use shutdown (man sudo ;-).
The alias line then would be something like

alias sd="sudo shutdown -h 0"

xviddivxoggmp3 05-12-2004 04:48 PM

now is with out any second delay.
0 means 0 second delay.
I'm not sure, but I would believe they would be the same.
unless it counts miliseconds prior to the 1st second.
I would believe it would be the same.


All times are GMT -5. The time now is 03:30 AM.