Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 230252 - yum should terminate on SIGTERM
Summary: yum should terminate on SIGTERM
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-02-27 19:53 UTC by Frank Ch. Eigler
Modified: 2014-01-21 22:57 UTC (History)
1 user (show)

Fixed In Version: 3.2.8-2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-03-12 13:57:29 UTC
Type: ---


Attachments (Terms of Use)

Description Frank Ch. Eigler 2007-02-27 19:53:36 UTC
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 19:23:03 UTC
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 13:59:02 UTC
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 14:05:19 UTC
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 14:37:53 UTC
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 14:45:07 UTC
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 14:59:37 UTC
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 15:12:23 UTC
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 15:19:05 UTC
Bug #358391 was opened for the multiple-Ctrl+C issue.

Comment 9 Seth Vidal 2007-10-30 15:19:58 UTC
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 13:57:29 UTC
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.