linux - Script to power off a pc too brutal? -
based on site: shutting down debian linux machine, wrote script power off debian computer. however, feel it's brutal, power cut off accident or something. want script behave human power off. case or script forcing computer power off abnormally?
#!/bin/bash sudo poweroff
why worried? because when run script, computer powers off immediately, while choosing power off gui takes time complete process of powering off.
in other words question is:
is equivalent pressing power button of computer's power or quivalnet selecting power off gui environment?
/etc/init.d
shows list of programs, sudo, powerpff not listed there.
/etc/rc.local
this:
exit 0
is better? or maybe combination of exit
, poweroff
better?
poweroff
ok point of view. switch off computer that. (as mentioned) end correctly running services , syncs disks. it not @ hardware unplug. if have running, instalation, updates... gets kill signal , loose work. same gui programs.
if want protect running programs against poweroff, must elaborate on script.
poweroff
, halt
links reboot
. reboot
-f
reboots itself, else (i.e. typically) calls shutdown
tool (seeman reboot
). means anyway, in cases, end shutdown
call.
Comments
Post a Comment