Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
45
rated 0 times [  45] [ 0]  / answers: 1 / hits: 67403  / 2 Years ago, wed, march 2, 2022, 2:13:39

Ubuntu one remote uses sudo -S -p '' halt for shutdown and does not work to the end.
leaveing monitor on with message



will now halt


[22225.11163] halted



What is the difference between sudo -S -p " halt and sudo shutdown now?


More From » shutdown

 Answers
3

The -S and -p switches for sudo have no importance in this case. Here is what they do, respectively.



The -S switch causes sudo to read the password from STDIN. This allows, for example, a password to be piped to sudo through echo or cat.


The -p switch allows you to override the default password prompt and use a custom one, or none at all.





The important difference is in the two commands being issued by sudo.



The halt command, if invoked without the -p switch, simply halts the OS and stops all CPUs. Once the system is cleanly halted, the user may safely hit the Power button on his computer manually.


The poweroff, shutdown -h now, and halt -p commands all do the same thing as halt alone, while additionally sending an ACPI command to signal the power supply unit to disconnect the main power. This prevents you from having to physically push the Power button on your computer.



[#35471] Thursday, March 3, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
atchcommo

Total Points: 114
Total Questions: 130
Total Answers: 101

Location: Cook Islands
Member since Sat, Oct 16, 2021
3 Years ago
;