image
image

Go Back   macosx.com > Mac Help Forums > HOWTO & FAQs

Reply
 
Thread Tools
  #1  
Old December 3rd, 2002, 12:05 AM
~departed~
 
Join Date: Jul 2002
Location: Kansas City, MO
Posts: 457
Thanks: 0
Thanked 0 Times in 0 Posts
gatorparrots is on a distinguished road
Restart without restarting

Your uptime can be as long as your machine has physical power (providing you have no errant kernel extensions or something else that causes a kernel panic). Simply learn the power of SystemStarter

You can leave the kernel and core operating system running and just restart the various StartupItems material [the scripts in /System/Library/StartupItems and /Library/StartupItems] without actually restarting the Darwin OS itself.

This from the man page:
Code:
DESCRIPTION
     The SystemStarter utility may be used to start, stop, and restart the
     system services which are described in the /Library/StartupItems/ and
     /System/Library/StartupItems/ paths.

     The optional action argument specifies which action SystemStarter per-
     forms on the startup items.  The optional service argument specifies
     which startup items to perform the action on.  If no service is speci-
     fied, all startup items will be acted on; otherwise, only the item pro-
     viding the service, any items it requires, or any items that depend on it
     will be acted on.

     During boot SystemStarter is invoked by rc (see rc(8)) and is responsible
     for starting all startup items in an order that satisfies each item's
     requirements.
For example, to restart a specific daemon such as NetInfo:
sudo SystemStarter restart NetInfo

Or issue a blanket command that restarts all of the core services*:
sudo SystemStarter restart
In many cases, this will be as effective as a reboot (since this is what rc invokes anyway).

*One caveat is that all the start, stop, and restart options do is pass the prescribed argument to the various startup scripts. If the syntax issued is incorrect for that daemon, nothing happens. An example is AppServices, which controls coreservicesd. Sending stop or restart to this script has no effect.
Reply With Quote
  #2  
Old December 3rd, 2002, 12:21 AM
Ricky's Avatar
Some Yahoo!
 
Join Date: Aug 2001
Location: Bay Area, CA
Posts: 2,079
Thanks: 0
Thanked 0 Times in 0 Posts
Ricky is on a distinguished road
That's a really great command. Very very useful. Thanks for sharing that!

Now, why can't installers just do this command?
__________________
Mac Pro Xeon 4x2.66 GHz | OS X 10.4.7, WinXP | 3 GB RAM | 250 GB HD | 250 GB HD | 300 GB HD
MacBook Core Duo 2.0 GHz | OS X 10.4.7 | 1 GB RAM | 80 GB HD
Mac mini Core Solo 1.5 GHz | OS X 10.4.7 and Windows XP SP2 | 512 MB RAM | 60 GB HD | 400 GB HD
Pentium 4 3.06 GHz | Windows XP SP2 and OS X 10.4.3 | 1.5 GB RAM | 100 and 120 GB HD
Reply With Quote
  #3  
Old December 3rd, 2002, 03:41 AM
uoba's Avatar
Re: member
 
Join Date: Aug 2001
Location: Merseyside, UK
Posts: 1,726
Thanks: 0
Thanked 0 Times in 0 Posts
uoba is on a distinguished road
So I could restart up our OS X (client system) server via SSH?

If so, greaatt!
Reply With Quote
  #4  
Old December 3rd, 2002, 09:56 AM
~departed~
 
Join Date: Jul 2002
Location: Kansas City, MO
Posts: 457
Thanks: 0
Thanked 0 Times in 0 Posts
gatorparrots is on a distinguished road
To perform an actual full restart of a machine, just SSH in and issue this command:
sudo shutdown -r now

The point of this thread, however, is to point out that in many situations, a full restart is unnecessary. In most cases, you won't need to bring the whole machine down and back up.
Reply With Quote
  #5  
Old December 3rd, 2002, 11:44 AM
Captain Code's Avatar
Moderator
 
Join Date: Aug 2001
Location: Ontario, Canada
Posts: 3,108
Thanks: 0
Thanked 1 Time in 1 Post
Captain Code will become famous soon enough
That's cool! I have to go try it now
__________________
MacBook Pro 2.16GHz Core2Duo 3GB RAM, G4 1.4GHz OSX Tiger 1.25GB RAM, Dual 2GHz G5 OSX Tiger 2GB RAM (freakin shweet)
Athlon 64 Windoze XP for school work (programming) 1GB RAM
dferns@macosx.com
Reply With Quote
  #6  
Old December 3rd, 2002, 11:08 PM
Registered User
 
Join Date: Dec 2001
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
alligatorTim is on a distinguished road
Quote:
sudo shutdown -r now
don't forget the "-r" .. i did that today. kind of neat actually.. the gui disapeared and it dropped me into my shell, but then blew a bootstrap error before being able to shutdown all the way so i was temporarily stuck there.
Reply With Quote
  #7  
Old December 3rd, 2002, 11:10 PM
Registered User
 
Join Date: Dec 2001
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
alligatorTim is on a distinguished road
that reminds me .. anyone know how to start os x from the command line?
Reply With Quote
  #8  
Old December 4th, 2002, 12:09 AM
kommakazi's Avatar
Hack the Planet!@#
 
Join Date: Jan 2002
Location: /Users/peter
Posts: 319
Thanks: 0
Thanked 0 Times in 0 Posts
kommakazi is on a distinguished road
I've known this for some time, never thought to share it though, it is quite useful. And it looks funny when the OS X boot screen pops up on top of your desktop (use -g).
And why would you use 'sudo shutdown -r now' when you can just type 'sudo reboot'...using shutdown with the -r option just calls reboot anyways. Save yourself some typing
As for starting the rest of OS X from the command-line (single-user mode I'm assuming?) make sure to mount your volumes read/write and then just run 'SystemStarter -g' (without the quotes obviously...the -g is for graphical startup)

(edit)
Well I just tested the method I described above for starting the rest of OS X from single-user mode and it seems to just leave my iBook trapped on the generic blue desktop after starting all the system services... I know it worked on previous versions of OS X, I guess they changed it in 10.2 so it doesn't work... Then again they've changed a lot of things you can and can't do from single-user... I could change your root password to whatever I want from single user without having to know what it was originally on 10.0.x....ahh the good old days
__________________
If it's a penny for your thoughts and you always put your two cents worth in, who's getting all these extra pennies?!

The Home Network:
iceBook: 500mhz G3, 384MB RAM, Mac OS X.II.II
B&W Tower: 450mhz G3, 512MB RAM, Mac OS X.II.II
Rev. A iMac: 233mhz G3, 256MB RAM, Mac OS 9.2.2
Mac LC III+: 33mhz 68030, 12MB RAM, NetBSD 1.5.2
Stupid PC: 233mhz Athalon K-6, 80MB RAM, Rhapsody DR2

Last edited by kommakazi; December 4th, 2002 at 12:20 AM.
Reply With Quote
Reply

Thread Tools

Posting 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 Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -5. The time now is 11:37 AM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.