|
#1
| |||
| |||
| 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. 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. |
|
#2
| ||||
| ||||
| 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 |
|
#3
| ||||
| ||||
| So I could restart up our OS X (client system) server via SSH? If so, greaatt! |
|
#4
| |||
| |||
| 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. |
|
#5
| ||||
| ||||
| 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 |
|
#6
| |||
| |||
| Quote:
|
|
#7
| |||
| |||
| that reminds me .. anyone know how to start os x from the command line? |
|
#8
| ||||
| ||||
| 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. |