- 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?
-
This is a duplicate of the following question: askubuntu.com/questions/93542/…– FabbyNov 18, 2014 at 7:33
-
I think it is a bug: bugs.launchpad.net/ubuntu/+source/unity/+bug/1281058– TakkatNov 4, 2016 at 19:56
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:
-
1That doesn't seem to be the case for me. LibreOffice also just shuts down immediately without prompting me to do any saving.– xjiDec 18, 2015 at 14:41
-
1+1 - in 16.04, I'm just seeing all applications terminate without prompt. I've lost unsaved work this way. Nov 4, 2016 at 18:15
-
So on 16.04 I should be experiencing the 90s delay, right? I'm seeing no visible delay at all. Applications close and you get the black terminal screen with a few messages for a couple seconds and then the box reboots. Nov 4, 2016 at 19:29
-
Good point, I will try with
gedit
on my next restart. If anyone has the chance, tell me howgedit
(aka "Text Editor" in Ubuntu) reacts when you have an open unsaved document with text at restart on your system. Nov 4, 2016 at 19:35 -
@BeeOnRope: thank you for bringing this up. Unlike when I wrote the answer back in 2014 all releases I tested this did now simply kill all running apps leading to loss of unsaved data. Too bad.– TakkatNov 4, 2016 at 19:45
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.
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.
-
Not gonna down-vote, but Canonical is also targeting regular non-technical users with Ubuntu. Not having your shutdown suspended because apps have unsaved work is a major problem (even for a Linux-savvy person). The fact is everybody may end up forgetting to save something, and the only way for me right now to reliably shutdown my Ubuntu 17.10 without losing any unsaved work, is by going ahead an closing all windows on all desktops before powering off. Excuse me but this is BS.– AnthonyJul 28, 2018 at 12:54