Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > shutdown command

shutdown command
Thread Tools
Fresh-Faced Recruit
Join Date: Nov 2002
Status: Offline
Reply With Quote
Sep 27, 2005, 09:00 AM
 
hi there
I am looking for the shell command to shut down my computer when my computer isn’t logged in. I know “sudo shutdown -h” seems to be correct, but this command doesn’t work when I am logged out because sudo needs a password. Anyone here who can give me an advice?
     
Junior Member
Join Date: Nov 1999
Location: Rochester, MN
Status: Offline
Reply With Quote
Sep 27, 2005, 11:45 AM
 
I am not quite sure what you are asking... try /sbin/halt
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Sep 27, 2005, 12:19 PM
 
You can't do anything when you aren't logged in. You must be logged in as some user.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Grizzled Veteran
Join Date: Apr 2002
Location: case.edu
Status: Offline
Reply With Quote
Sep 27, 2005, 01:25 PM
 
Normal users might be able to do '/sbin/halt' or '/sbin/shutdown -h now'.
As Chuckit says, you have to be logged in to do anything (though not necessarily as root, and not necessarily a graphical login session).

pb 1440x960 | 1.67, 1.5, 128, 80 | leopard
     
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status: Offline
Reply With Quote
Sep 27, 2005, 10:18 PM
 
If you are trying to write a shell script to shutdown the machine, the command is simply "shutdown -h now", but the script must be run as root. If the script doesn't have root access, there's no way to shutdown the machine. If there is, it's a security hole that needs to be closed.

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
     
Fresh-Faced Recruit
Join Date: Nov 2002
Status: Offline
Reply With Quote
Sep 29, 2005, 02:31 PM
 
Thank you for your help. ok, I accept it that I have to login.

here's my next problem ;-)

I am using this little Apple Script and saved it as an application.

tell application "Finder"

shut down

end tell

When I paste the absolute path to this apple app into my shell script, Tiger pops up a dialogbox whether I want to quit or to run the script. However my computer should shutdown without a message. Any ideas?
     
Junior Member
Join Date: Sep 2005
Location: J a p a n
Status: Offline
Reply With Quote
Sep 29, 2005, 06:10 PM
 
When you select "shut down" from the Apple menu, it asks if you are sure. There's a little 2 minute count down timer on that dialog box. Is that what you mean? If you wait the 2 minutes the machine will automatically shutdown anyway ...
     
Fresh-Faced Recruit
Join Date: Nov 2002
Status: Offline
Reply With Quote
Sep 30, 2005, 09:29 AM
 
Hi there,
thank your replies. I solved my problem. I didn't save my AppleScript with the correct settings. The app should be "read-only". that's it!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:13 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2