yum doesn't die from a SIGTERM. Like the energizer bunny, it keeps going. It's ok for SIGINT to try other mirrors and stuff. But SIGTERM should not be thusly conflated. Version-Release number of selected component (if applicable): 3.1.0-2.fc7
Dying on SIGTERM, though, could lead to corrupted rpmdbs. It's far better to hold off on exiting until we can safely do so.
I agree that aborting during rpm transactions wouldn't be safe, but yum is unkillable (without kill -9) while it is downloading packages, also. Isn't it possible to simply not switch to another mirror and go through the same code path it goes when downloading fails?
I don't know what version of yum you used last but it's been killable with ctrl-c since rpm was updated sometime in the middle of f7.
I have tested using yum-3.2.0-1.fc7. I have just upgraded to yum-3.2.7-1.fc7 and tested it: Total download size: 209 M Is this ok [y/N]: y Downloading Packages: (1/2): kernel-debuginfo-c 100% |=========================| 688 kB 00:07 (killall yum ran on another terminal) http://mirrors.usc.edu/pub/linux/distributions/fedora/linux/releases/7/Everything/i386/debug/kernel-debuginfo-common-2.6.21-1.3194.fc7.i686.rpm: [Errno 4] Socket Error: (4, 'Interrupted system call') Trying other mirror. (1/2): kernel-debuginfo-c 100% |=========================| 440 kB 00:05 (killall yum again) http://mirror.steadfast.net/fedora/releases/7/Everything/i386/debug/kernel-debuginfo-common-2.6.21-1.3194.fc7.i686.rpm: [Errno 4] Socket Error: (4, 'Interrupted system call') Trying other mirror. (1/2): kernel-debuginfo-c 1% | | 464 kB 06:03 ETA Trying with Ctrl+C: (1/2): kernel-debuginfo-c 100% |=========================| 496 kB 00:17 (Ctrl+C pressed) http://ftp.uni-bayreuth.de/linux/fedora/linux/releases/7/Everything/i386/debug/kernel-debuginfo-common-2.6.21-1.3194.fc7.i686.rpm: [Errno 4] Socket Error: (4, 'Interrupted system call') Trying other mirror. (1/2): kernel-debuginfo-c 100% |=========================| 3.1 MB 00:24 (Ctrl+C pressed) http://ftp.linux.ncsu.edu/pub/fedora/linux/releases/7/Everything/i386/debug/kernel-debuginfo-common-2.6.21-1.3194.fc7.i686.rpm: [Errno 4] Socket Error: (4, 'Interrupted system call') Trying other mirror. Switching mirrors on Ctrl+C could be considered a feature (that I disagree if there is no other way to interrupt it). However, I consider not exiting and trying to switch mirrors after getting a SIGTERM, a bug.
press ctrl-c twice in a row during a single download. It should abort. sometimes it takes 3 ctrl-c's. They're timed and ctrl-c once skipping mirrors is a feature.
The topic is SIGTERM, not SIGINT. There appears to be no programmatic way to kill yum nicely during the download.
I have tried the multiple ctrl+c feature anyway, and it didn't work. I kept hitting ctrl+c during the download around 4 times per second. yum tried every single mirror and took 1 minute and 30 seconds (I was hitting quickly ctrl+c during all this time) until it finally aborted with "No more mirrors to try". I have tried running 'while :;do killall yum;done' on another terminal. yum tried every mirror, also. It took 40 seconds to terminate on this case. These tests were ran on Rawhide (yum-3.2.7-1.fc8). Even after this work, I consider not aborting on SIGTERM a bug. The behaviour for Ctrl+C is a user-interface feature, but IMO the behaviour to SIGTERM should be termination, not switching mirrors. So, we have two different problems: multiple-Ctrl+C aborting is not working and SIGTERM making it switch mirrors instead of terminating. Should I reopen this bug, or open distinct bug reports for those?
Bug #358391 was opened for the multiple-Ctrl+C issue.
I can make it abort on ctrl-c during pkg download every time. Here is what I'm running: rpm -q yum rpm python yum-3.2.7-1.fc8 rpm-4.4.2.2-3.fc8 python-2.5.1-14.fc8 all from rawhide. Is that the same for you?
closing this - I've tested it over and over now and downloads ctrl-c correctly