Power off a Solaris system

Contributor Icon Contributed by qmchenry Date Icon September 4, 2003  
Tag Icon Tagged: Solaris

Safely turn off a Solaris system using the init command


As superuser,

sync; sync; init 5

Using the init command instead of other options causes the system to use the runtime control scripts in /etc/rc0.d to stop system processes nicely and prevent data corruption.

Previous recipe | Next recipe |
 

Viewing 2 Comments

    • ^
    • v
    Sync is no longer necessary in any modern version of Unix (Solaris and Linux included). If you're a system administrator, you should learn proper use of the init command, which allows you to change runlevels. Here are a few different uses of init:

    # init 6 - reboots the system
    # init 5 - halts the system (turns power off)
    # init 0 - sends you to runlevel 0, which is the "ok" prompt (OpenBoot PROM)
    # init 1 - sends you to single user mode, useful for installing patches.
    • ^
    • v
    You could use the Sun recommended shutdown command. :wink:

    shutdown -y -i5 -g0

    look up the man page, but the i option specifies run level, the g option grace period in seconds before the shutdown and the y options answer yes to the usual question of are you sure.
 
close Reblog this comment
blog comments powered by Disqus