Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
^C doesn't kill emerge [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
SemmZemm
n00b
n00b


Joined: 05 Jul 2013
Posts: 62
Location: France, Russia

PostPosted: Mon Oct 14, 2013 12:04 am    Post subject: ^C doesn't kill emerge [SOLVED] Reply with quote

Hi,

When I try to kill emerge using ^C (ctrl+C) it doesn't work. It just puts ^C on terminal.
For example I can't cancel unmerging some package. I use bash as CLI. ^X, ^Z neither don't work

Some additional information:

Code:
szldlc semmzemm # equery l bash
 * Searching for bash ...
[IP-] [  ] app-shells/bash-4.2_p45:0
szldlc semmzemm # uname -a
Linux szldlc 3.11.4-gentoo #1 SMP Mon Oct 7 14:21:26 CEST 2013 x86_64 Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz GenuineIntel GNU/Linux
szldlc semmzemm # equery l portage
 * Searching for portage ...
[IP-] [  ] sys-apps/portage-2.2.7:0


Thanks in advance!


Last edited by SemmZemm on Wed Oct 16, 2013 8:56 am; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21631

PostPosted: Mon Oct 14, 2013 12:14 am    Post subject: Reply with quote

This works for me. Did you disable job control on your terminal?
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6051
Location: Removed by Neddy

PostPosted: Mon Oct 14, 2013 12:15 am    Post subject: Reply with quote

It will do but emerge spawns a load of other processes. I generally hammer ctrl-c when I want to break out
_________________
Quote:
Removed by Chiitoo
Back to top
View user's profile Send private message
SemmZemm
n00b
n00b


Joined: 05 Jul 2013
Posts: 62
Location: France, Russia

PostPosted: Mon Oct 14, 2013 12:01 pm    Post subject: Reply with quote

Hu wrote:
This works for me. Did you disable job control on your terminal?

Hm. Surely I didn't do it intentionally, how can I check it?

Naib wrote:
It will do but emerge spawns a load of other processes. I generally hammer ctrl-c when I want to break out

But normally if I kill parent process I must also kill the children? I'd like to have this hammer too.
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6051
Location: Removed by Neddy

PostPosted: Mon Oct 14, 2013 6:47 pm    Post subject: Reply with quote

You are not killing the parent though but one of the children
_________________
Quote:
Removed by Chiitoo
Back to top
View user's profile Send private message
SemmZemm
n00b
n00b


Joined: 05 Jul 2013
Posts: 62
Location: France, Russia

PostPosted: Mon Oct 14, 2013 9:24 pm    Post subject: Reply with quote

The same behaviour for traceroute. It doesn't create children processes. What I did wrong?
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Tue Oct 15, 2013 1:37 am    Post subject: Reply with quote

Not sure about traceroute, but essentially if a process doesn't respond to signals, there's not much you can do besides wait, and eventually try kill -9. Note you should never do that normally: in update we step through SIGTERM, SIGINT and SIGQUIT (twice each), and only eventually use kill -9 after waiting 18 seconds (we wait for 3 seconds with each signal * 2.) And we do this only because we know that on restart emerge will start over, and the user wants to quit now.

Note this has nothing to do with trying to kill the children, since we know the pid of the main emerge process. It just isn't responding, since it's blocked waiting for its children (or something;)

Hmm 18 seconds seems like a long time. It rarely needs all of it tho (ie we normally see: "Terminating...\n Again .....done" vs "..forcefully.")
Back to top
View user's profile Send private message
SemmZemm
n00b
n00b


Joined: 05 Jul 2013
Posts: 62
Location: France, Russia

PostPosted: Tue Oct 15, 2013 9:19 am    Post subject: Reply with quote

I know about kill, sometimes it's useful but I just want to understand why ^C doesn't work like before and to get back possiblity kill processes in the terminal like I'm used to do it.
Back to top
View user's profile Send private message
Atom2
Apprentice
Apprentice


Joined: 01 Aug 2011
Posts: 185

PostPosted: Tue Oct 15, 2013 9:37 pm    Post subject: Reply with quote

SemmZemm wrote:
I just want to understand why ^C doesn't work like before and to get back possiblity kill processes in the terminal like I'm used to do it.

I might be wrong, but my suspicion is that your terminal line settings are f***ed-up. Diagnosing any such issues, however, is straightforward and works as follows:
Code:
$ stty -a
speed 38400 baud; rows 43; columns 132; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S;
susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts -cdtrdsr
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
The interesting part is the first value in the second line assigned to the intr attribute - which in my example reads ^C and thus translates to Ctrl-C. My assumption is that this value is most likely different in your case.

The good news is that the value assigned to intr is configurable and can easily be changed to another value. An example would be
Code:
$ stty intr "^K"
which results in changing the current value (Ctrl-C in my first example above) to Ctrl-K. After this Ctrl-C would no longer send the signal SIGINT (that's what intr actually does) but rather Ctrl-K would send SIGINT to the current foreground process (and thus terminate this process [that is: unless SIGINT is handled or ignored by the process]). The changed value for intr can now easily be checked again as follows:
Code:
$ stty -a
speed 38400 baud; rows 43; columns 132; line = 0;
intr = ^K; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S;
susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts -cdtrdsr
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
The name intr by the way clearly resembles a link to the corresponding signal SIGINT.

Reasonable default values (including resetting the value of intr to Ctrl-C) are available by issuing
Code:
$ stty sane
or, in case you just want to reset intr to Ctrl-C, you could also type
Code:
$ stty intr "^C"
Back to top
View user's profile Send private message
SemmZemm
n00b
n00b


Joined: 05 Jul 2013
Posts: 62
Location: France, Russia

PostPosted: Tue Oct 15, 2013 10:49 pm    Post subject: Reply with quote

It was ^C for me. I tried to change it to ^K but demonstrates the same behaviour.

But anyway, thank you for the try, Atom2
Back to top
View user's profile Send private message
paulj
Guru
Guru


Joined: 30 Sep 2004
Posts: 513
Location: Wales, UK

PostPosted: Wed Oct 16, 2013 5:01 am    Post subject: Reply with quote

This might sound strange - I had this problem, and came across a post about nvidia-drivers causing this problem (written in 2009). Anyway, I downgraded to the stable version of nvidia-drivers, and the problem disappeared. I am busy sorting another issue on my system at the moment, and then I plan to go back and confirm if this problem is indeed related to nvidia-drivers.

I can't be sure yet, so normally I wouldn't post anything in the forums, but as you have the same problem, it might be worth a try if you have unstable nvidia-drivers installed.

I was on 331.13, and now I am back on 319.49.
Back to top
View user's profile Send private message
SemmZemm
n00b
n00b


Joined: 05 Jul 2013
Posts: 62
Location: France, Russia

PostPosted: Wed Oct 16, 2013 8:55 am    Post subject: Reply with quote

paulj wrote:
This might sound strange - I had this problem, and came across a post about nvidia-drivers causing this problem (written in 2009). Anyway, I downgraded to the stable version of nvidia-drivers, and the problem disappeared. I am busy sorting another issue on my system at the moment, and then I plan to go back and confirm if this problem is indeed related to nvidia-drivers.

I can't be sure yet, so normally I wouldn't post anything in the forums, but as you have the same problem, it might be worth a try if you have unstable nvidia-drivers installed.

I was on 331.13, and now I am back on 319.49.


Amazing! It works fine with 319.49. Thanks a lot!
Back to top
View user's profile Send private message
paulj
Guru
Guru


Joined: 30 Sep 2004
Posts: 513
Location: Wales, UK

PostPosted: Wed Oct 16, 2013 10:43 am    Post subject: Reply with quote

Glad to have been able to help. I'll narrow down the issue then post a bug (although I suspect it should go upstream).
Back to top
View user's profile Send private message
SemmZemm
n00b
n00b


Joined: 05 Jul 2013
Posts: 62
Location: France, Russia

PostPosted: Wed Oct 16, 2013 12:10 pm    Post subject: Reply with quote

paulj wrote:
Glad to have been able to help. I'll narrow down the issue then post a bug (although I suspect it should go upstream).


I'm not sure I should report the bug, because I have 3.11.4 kernel and I compiled drivers with 3rd part patch.
During the installation I'm prevented to not do a report if I have kernel version >=3.11
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Sun Oct 20, 2013 7:33 pm    Post subject: Reply with quote

this also occurs on some packages (e.g. portage, wine, etc.) from time to time

can't tell when or why


anyways: *subscribed*

so that I know that I have to investigate further later ...
_________________
https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0
https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21631

PostPosted: Sun Oct 20, 2013 8:30 pm    Post subject: Reply with quote

There are multiple upstream projects here. If you can reproduce the problem with an untainted kernel, you could report it to the kernel maintainers. If it happens only when you load the proprietary nVidia module, then you need to bug nVidia to fix their driver.
Back to top
View user's profile Send private message
Josef.95
Advocate
Advocate


Joined: 03 Sep 2007
Posts: 4553
Location: Germany

PostPosted: Mon Oct 21, 2013 1:07 am    Post subject: Reply with quote

Sounds like Bug 487700
Back to top
View user's profile Send private message
SemmZemm
n00b
n00b


Joined: 05 Jul 2013
Posts: 62
Location: France, Russia

PostPosted: Mon Oct 21, 2013 1:28 pm    Post subject: Reply with quote

Bug reported to nVidia

http://nvidia-submit.custhelp.com/app/account/questions/detail/i_id/553304
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum