¿Cuál es la diferencia entre emitir un comando shutdown -h now
en la terminal y apagar desde el menú de Apple?
Al usar el comando, se apaga instantáneamente el sistema. Pero a través del menú, toma alrededor de 30-40 segundos.
¿También es seguro usar el comando shutdown -h now
todo el tiempo?
De la shutdown
página del manual:
Upon shutdown, all running processes are sent a SIGTERM followed by a
SIGKILL. The SIGKILL will follow the SIGTERM by an intentionally inde-
terminate period of time. Programs are expected to take only enough time
to flush all dirty data and exit. Developers are encouraged to file a
bug with the OS vendor, should they encounter an issue with this func-
tionality.
Entonces, por lo que entiendo, los procesos pueden eliminarse antes de que se hayan limpiado adecuadamente.
De la launchctl
página del manual:
reboot [system|userspace|halt|logout|apps|reroot <mount-point>]
Instructs launchd to begin tearing down userspace. With no argu-
ment given or with the system argument given, launchd will make
the reboot(2) system call when userspace has been completely
torn down. With the halt argument given, launchd will make the
reboot(2) system call when userspace has been completely torn
down and pass the RB_HALT flag, halting the system and not ini-
tiating a reboot.
Esto es lo que creo que hace el apagado a través del menú, es mejor ya que garantiza que todos los procesos de la zona de usuario se cierren limpiamente antes de detener/reiniciar el sistema.
Me sentiría tentado a decir que el launchctl
método es mejor, y que el shutdown -h now
método podría dar lugar a algunas rarezas si se elimina un proceso antes de limpiarse correctamente.
gordon davisson
shutdown -h
no tendrá la oportunidad de guardarlos. No estoy seguro dellaunchctl
método...