- When I shutdown Ubuntu system, it does not restrict me, but allows me to shutdown my system without closing all programs.
- Why it doesn't restrict me to close all programs?
- 73
3 Answers
Ubuntu will send the SIGTERM signal to allow running applications to gracefully terminate and close their open processes. Only if an application does not listen to SIGTERM it may be killed.
In case a running application needs user interaction (test this with an opened unsaved document from LibreOffice) the shutdown will be halted until the user interacted.
On a multi-user system a user-initiated shutdown will be halted as long as other users are logged in. We need root privileges to still be able to shutdown. Then the SIGTERM signal will be sent to all open applications in all running sessions.
If is supposed that after a timeout (90 s) the user or the applications did not react on the SIGTERM signal SIGKILL should be issued which only then should lead to loss of unsaved data. The default KILL timeout for SIGTERM issued by upstart is much shorter (5 s).
Testing on present release showed however that we can always shutdown without being prompted for saving our other other logged in user's unfinished work. As this indeed may lead to data loss I consider this a bug:
- 144,580
As per my experience with Ubuntu and other Linux distributions. When you shutdown your computer, the kernel automatically sends a close notification to all open programs. It then shuts down after killing all processes including networks. Windows have a feature which works a little bit differently, if open processes require a file to be saved, the shutdown process is paused for some time until user interaction is observed.
- 11
shutdown does its job by signalling the init process, asking it to change the runlevel. Runlevel 0 is used to halt the system.
So when run level changed to 0 i.e init 0. init get killed . Actually init is the parent process of all processes running in system. if parent process died then all child process will become zombies i.e they are not real process and not considerable.
i.e all are closed.
Read its Man-Page , All you have to do is some research on shutdown process.
- 105,327
- 107
- 262
- 331