[Yum] suggestion: CTRL-C should immediately stop yum

Menno Smits menno-yum at freshfoo.com
Tue Sep 12 21:59:53 UTC 2006


Hi Adam,

Adam Monsen wrote:
> I have a suggestion for the command-line yum client: CTRL-C should cause 
> the program to immediately stop.
> 
> Most other command-line programs behave this way. I found on some other 
> mailing list that holding down CTRL-C causes yum to spit out the message 
> "Exiting on user cancel", and return exit code 130. This works, but is 
> somewhat inconvenient.
> 
> Currently (I'm using 2.6.1-0.fc5) yum appears to try and switch mirrors 
> if CTRL-C is pressed or a SIGINT is sent to the yum process. Perhaps 
> SIGUSR1 or something could be used to forcibly switch mirrors.
 >
 > Thoughts?
 >

The CTRL-C misbehaviour is caused by the rpm API taking control of the 
handlers for termination signals such as SIGINT. I've fixed the problem 
in the latest Yum versions (CVS). Yum now only has the rpmdb open when 
strictly necessary so that it can handle signals properly itself.

In the new version, CTRL-C once during downloads causes a mirror switch; 
twice in quick succession causes termination. A single CTRL-C at other 
times should just quit as normal.

Menno






More information about the Yum mailing list