On Sunday 17 Jul 2011, Sharad Birmiwal wrote:
>  On Fri, Jul 15, 2011 at 4:59 AM, Anupam Jain <ajn...@gmail.com> 
wrote:
> > Hi all,
> > 
> > I originally posted this question on
> > stackoverflow<http://stackoverflow.com/questions/6624622/what-happe
> > ns-in-bash-when-you-do-ctrl-c-hint-its-not-simply-sending-a-sigint>
> > , but did not receive a satisfactory response. Any ideas?
> 
> Mystery solved!
> 
> The reason is because apt-get invokes a program called http to
> download packages. Here is what I tried.
> 
> Terminal 1
> 
> $ sudo su
> $ apt-get install wetlands-data   (some package I found randomly to
> be big)
> 
> Terminal 2
> 
>  8493 pts/0    S+     0:00 apt-get install widelands-data
>  8495 pts/0    S+     0:00 /usr/lib/apt/methods/http
> 
> When you press control+c, the signal is sent to http and NOT apt-get.
> That's the difference. I tried sending SIGINT to process 8495 and I
> was able to resume download :)

Quite fascinating.  Apparently when you ^C in the shell, it sends the 
signal to the running process and all its child processes, whereas if 
you SIGINT sudo it doesn't seem to pass the signal down.  Question is, 
why?

How about an strace of both methods to see what is the difference in 
signal handling between the shell and sudo?  I'd do it myself but I'm 
too lazy^H^H^H^H^H^H^H^H have too much work on my plate right now ;-)

Regards,

-- Raj
-- 
Raj Mathur                r...@kandalaya.org      http://kandalaya.org/
       GPG: 78D4 FC67 367F 40E2 0DD5  0FEF C968 D0EF CC68 D17F
PsyTrance & Chill: http://schizoid.in/   ||   It is the mind that moves

_______________________________________________
Ilugd mailing list
Ilugd@lists.linux-delhi.org
http://frodo.hserus.net/mailman/listinfo/ilugd

Reply via email to