Operating System - HP-UX
1822020 Members
3610 Online
109639 Solutions
New Discussion юеВ

What are difference between comand "shutdown 0" , "init -s" and "init -S"

 
Worapoj P.
Regular Advisor

What are difference between comand "shutdown 0" , "init -s" and "init -S"

What are difference between "shutdown 0',"init -s" and "init -S" command?, when change system run level from normal level(3 or 4) to single user state.

Thanks for your answer,
Worapoj P.
For LOVE For Honor For Mankind
3 REPLIES 3
Venu_2
Regular Advisor

Re: What are difference between comand "shutdown 0" , "init -s" and "init -S"

Hi,

init S|s

Enter the single-user environment. When this level change occurs, the logical system console /dev/syscon is changed to the terminal from which the command was executed.

shutdown

Takes the system to single user mode and 0 indicates in zero seconds


regards

venu
Andreas Voss
Honored Contributor

Re: What are difference between comand "shutdown 0" , "init -s" and "init -S"

Hi,

take a look at the man pages:
man 1m shutdown
man 1m init
There you can see that shutdown 0 transients to single user mode in 0 minutes (grace).
The option -s and -S for init are equivalent.
The difference between shutdown an init is that shutdown sends a message to user and executes the rc-files for the desired run level.

Regards

Andrew
Worapoj P.
Regular Advisor

Re: What are difference between comand "shutdown 0" , "init -s" and "init -S"

Dear all,

Thanks for your answer please confirm my understanding about "init -s|S" and "shutdown" comand.

init -s|S
Enter to single user environment and console (/dev/syscon) is terminal which this comand was issued.

shutdown 0
Enter to single user state same as "init -s|S" but the diffrence way is" shutdowon" send message to user and don't change /dev/syscon to terminal which this command was issued. It's mean "shutdown" can exeuted on console only.
from Andrew's answer the difference shutdown an init is shutdown executes the rc-files for the desired run level. But I think init will do same as shutdown command.

Thank you very again. For any comment please let me know,

Best regards,
Worapoj P.



For LOVE For Honor For Mankind