This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 230252 - yum should terminate on SIGTERM
yum should terminate on SIGTERM
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-27 14:53 EST by Frank Ch. Eigler
Modified: 2014-01-21 17:57 EST (History)
1 user (show)

See Also:
Fixed In Version: 3.2.8-2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-03-12 09:57:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Frank Ch. Eigler 2007-02-27 14:53:36 EST
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
Comment 1 Jeremy Katz 2007-04-25 15:23:03 EDT
Dying on SIGTERM, though, could lead to corrupted rpmdbs.  It's far better to
hold off on exiting until we can safely do so.
Comment 2 Eduardo Habkost 2007-10-30 09:59:02 EDT
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?
Comment 3 Seth Vidal 2007-10-30 10:05:19 EDT
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.
Comment 4 Eduardo Habkost 2007-10-30 10:37:53 EDT
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.
Comment 5 Seth Vidal 2007-10-30 10:45:07 EDT
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.
Comment 6 Frank Ch. Eigler 2007-10-30 10:59:37 EDT
The topic is SIGTERM, not SIGINT.  There appears to be no programmatic way to
kill yum nicely during the download.
Comment 7 Eduardo Habkost 2007-10-30 11:12:23 EDT
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?
Comment 8 Eduardo Habkost 2007-10-30 11:19:05 EDT
Bug #358391 was opened for the multiple-Ctrl+C issue.
Comment 9 Seth Vidal 2007-10-30 11:19:58 EDT
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?




Comment 10 Seth Vidal 2008-03-12 09:57:29 EDT
closing this - I've tested it over and over now and downloads ctrl-c correctly

Note You need to log in before you can comment on or make changes to this bug.