- 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
-
This is a duplicate of the following question: http://askubuntu.com/questions/93542/how-to-disable-shutdown-reboot-suspend-hibernate – Fabby Nov 18 '14 at 07:33
-
I think it is a bug: https://bugs.launchpad.net/ubuntu/+source/unity/+bug/1281058 – Takkat Nov 04 '16 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:

- 142,284
-
1That doesn't seem to be the case for me. LibreOffice also just shuts down immediately without prompting me to do any saving. – xji Dec 18 '15 at 14:41
-
1+1 - in 16.04, I'm just seeing all applications terminate without prompt. I've lost unsaved work this way. – BeeOnRope Nov 04 '16 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. – BeeOnRope Nov 04 '16 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. – BeeOnRope Nov 04 '16 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. – Takkat Nov 04 '16 at 19:45
-
this is not the case in 16.04. I can shutdown even another user is logged in – Anwar Nov 04 '16 at 19:45
-
@Anwar - when you say "this is not the case", what is "this"? The recent thread hasn't been about other users being logged in, some I'm a bit confused. – BeeOnRope Nov 04 '16 at 19:50
-
@Takkat - thanks for the note! Seems like a pretty big change in behavior, but my googling didn't bring much up. Perhaps deserving of a new question. – BeeOnRope Nov 04 '16 at 19:50
-
@Takkat - just to be clear: your most recent edit (Testing on present release...) is talking about whether you will be prompted about other logged in users work - but I'm talking about a much simpler situation - there is only one user (me) and I'm referring to my open processes in the same login session. Are we are on the same page? – BeeOnRope Nov 04 '16 at 19:56
-
-
I think the "other user" question is quite separate. There is no obvious mechanism to prompt the other users if one use wants to shut down (indeed, they may not be sitting in front of the monitor). In the past, the CLI
shutdown
command always warned you about that, and perhaps required root if other users were active. On the other hand, in the very simple case of a single user initiating shutdown, he should be prompted about his own open applications. – BeeOnRope Nov 04 '16 at 20:02 -
We could always shutdown as sudo but not as a normal desktop user. It is closely related, as seen from a machine's point of view another user's desktop is just another open application. – Takkat Nov 04 '16 at 20:04
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.

- 102,391
- 106
- 255
- 328
-
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. – Anthony Jul 28 '18 at 12:54