LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   reboot vs poweroff??? (https://www.linuxquestions.org/questions/linux-newbie-8/reboot-vs-poweroff-346985/)

bigdog0007 07-26-2005 12:38 PM

reboot vs poweroff???
 
Hey guys ... I hope this is a quick fix :p

I wrote a menu script that is working great except for 1 option...(drumroll)... poweroff... below is segment of the script to compare.

Things to note:
The users shell is pointing at the script(security reasons)
A copy of the commands are in the home dir
The reboot and exit work just fine
The poweroff command just blinks and goes right back to the menu

Shutdown)
date>~/tmp/outputtext.tmp
echo "This CLS is now shutting down!">>~/tmp/outputtext.tmp
cat ~tmp/outputtext.tmp>>~/tmp/menuoutput.tmp
dialog --title "Shutdown" --backtitle "Menu for running diagnostics \
on this CLS " --textbox ~/tmp/outputtext.tmp 7 40
clear
/home/clsguest/bin/poweroff;;
#
Reboot)
date>~/tmp/outputtext.tmp
echo "This CLS is now going to Reboot!">>~/tmp/outputtext.tmp
cat ~tmp/outputtext.tmp>>~/tmp/menuoutput.tmp
dialog --title "Reboot" --backtitle "Menu for running diagnostics \
on this CLS " --textbox ~/tmp/outputtext.tmp 7 40
clear
/home/clsguest/bin/reboot -n;;
#
Exit)
date>~/tmp/outputtext.tmp
echo "Thank You for Using CommLogix!">>~/tmp/outputtext.tmp
cat ~/tmp/outputtext.tmp>>~/tmp/menuoutput.tmp
dialog --title "EXIT" --backtitle "Menu for running diagnostics \
on this CLS " --textbox ~/tmp/outputtext.tmp 7 35
clear
exit;;




Thanks in advance for your help :)

jtshaw 07-26-2005 12:59 PM

My guess the problem is in the poweroff executable... have you tried just running it as that user and seeing what it spits out?

bigdog0007 07-26-2005 01:07 PM

Thanks for the quick responce

The reason for changing the users shell is to keep the user from having any interaction with the command line... however i did change the users shell back to /bin/bash and can run the command from command line ...

PS... when I run the menu script as root everything works fine.

bigdog0007 08-02-2005 09:15 PM

I guess this is more or less a bump ... can anyone give me any ideas what I can do to get it to shutdown correctly?

shazam75 09-16-2005 02:48 AM

can u try:

/sbin/telinit 0

instead of shutdown.

Regards
Shelton.


All times are GMT -5. The time now is 07:00 PM.