When shutting down the computer (via shutdown -h now, for example), the procedure immediately after sending TERM signal sends the KILL signal, and does not even give time for the applications to close gracefully. This can be seen in several different situations, like when shutting down a computer middle of an emerge, the emerge does not have enough time to clean itself up and save information for --resume. Similar situations arise when an administrator remotely reboots the machine and user has, say KDE session open - KDE never gets to shut down properly and save the user's desktop status (which would allow the user continue where he left off with a minimal hassle after the reboot). Proposed fixes: Allow a longer grace period (5-10 seconds) between signals. OR When the shutdown procedure starts, send (only) TERM signal. Complete the shutdown as far as possible. As a last thing before poweroff/reboot, send another TERM, followed by a KILL. This issue has also been seen in Bug 41877.
this has been covered in bugzilla before ... iirc, the display is incorrect while the actual behavior is correct
It does not seem to be correct, because several applications (like I said, KDE and emerge itself) do not exit gracefully, but instead just die without saving their status. Just for the record, at least emerge DOES save its status when TERM is received, so the problem is not with the application. Take a look for this for example: ~ # emerge -av joe These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild N ] app-editors/joe-3.0-r2 303 kB Total size of downloads: 303 kB Do you want me to merge these packages? [Yes/No] y >>> emerge (1 of 1) app-editors/joe-3.0-r2 to / >>> Downloading http://130.230.54.100/gentoo/distfiles/joe-3.0.tar.gz --09:47:57-- http://130.230.54.100/gentoo/distfiles/joe-3.0.tar.gz => `/usr/portage/distfiles/joe-3.0.tar.gz' Connecting to 130.230.54.100:80... connected. HTTP request sent, awaiting response... 200 OK Length: 310,584 [application/x-tar] 100%[====================================>] 310,584 163.67K/s 09:47:59 (163.27 KB/s) - `/usr/portage/distfiles/joe-3.0.tar.gz' saved [310,584/310,584] >>> md5 files ;-) joe-3.0-r2.ebuild >>> md5 files ;-) joe-3.1-r1.ebuild >>> md5 files ;-) joe-3.2.ebuild >>> md5 files ;-) files/digest-joe-3.0-r2 >>> md5 files ;-) files/digest-joe-3.1-r1 >>> md5 files ;-) files/digest-joe-3.2 >>> md5 files ;-) files/joe-3.0-overflow.patch >>> md5 files ;-) files/joe-3.1-overflow.patch >>> md5 src_uri ;-) joe-3.0.tar.gz >>> Unpacking source... >>> Unpacking joe-3.0.tar.gz to /var/tmp/portage/joe-3.0-r2/work * Applying joe-3.0-overflow.patch ... [ ok ] * Using GNU config files from /usr/share/libtool * Updating config.sub [ ok ] * Updating config.guess [ ok ] >>> Source unpacked. [kill 29805 - the emerge process, in other window] [about 3 seconds of pause and stuff going to HDD] Exiting due to signal ~ # emerge --resume *** Resuming merge... >>> emerge (1 of 1) app-editors/joe-3.0-r2 to / .... When shutting down, the KILL goes of far too quickly.
*** This bug has been marked as a duplicate of 94443 ***
mmm maybe not a dupe but related
shutdown uses TERM, waits 3 or specified seconds, then KILL. The code in the present shutdown has: 305 /* First idle init. */ 306 if (kill(1, SIGTSTP) < 0) { 307 fprintf(stderr, "shutdown: can't idle init.\r\n"); 308 exit(1); 309 } 310 311 /* Kill all processes. */ 312 fprintf(stderr, "shutdown: sending all processes the TERM signal...\r\n"); 313 kill(-1, SIGTERM); 314 sleep(sltime ? atoi(sltime) : 3); 315 fprintf(stderr, "shutdown: sending all processes the KILL signal.\r\n"); 316 (void) kill(-1, SIGKILL); If you think it should be longer than 3 seconds, please reopen this bug. 3 seconds is enough time for my systems.