Bug 170433

Summary: konsole doesn't kill child process run as root when closing.
Product: [Applications] konsole Reporter: Bráulio Barros de Oliveira <brauliobo>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED LATER    
Severity: normal CC: adaptee, robertknight
Priority: NOR    
Version: 2.2   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Bráulio Barros de Oliveira 2008-09-05 01:56:34 UTC
Version:           2.2 (using 4.1.64 (KDE 4.1.64 (KDE 4.2 >= 20080828)), compiled sources)
Compiler:          gcc
OS:                Linux (x86_64) release 2.6.26-ARCH

hello,

as doing http://bugs.kde.org/show_bug.cgi?id=170432 I've noticed that after closing konsole powertop and iotop, which were ran inside konsole, were still running, both in a erroneous state, that is, using a lot of cpu.

i had a similar problem with a program i develop, and it was solved with setpgrp (for bash process exec) and kill. maybe?

bráulio
Comment 1 Bráulio Barros de Oliveira 2008-09-11 18:29:26 UTC
any news?
Comment 2 Robert Knight 2008-09-11 19:12:27 UTC
I presume the reason the child process is not being closed is because the parent process (Konsole) running as $USER doesn't have permission to kill the child which is running as root.

> i had a similar problem with a program i develop, and it was solved with 
> setpgrp (for bash process exec) and kill. maybe? 

Can you expand on this?
Comment 3 Bráulio Barros de Oliveira 2008-09-13 00:55:28 UTC
uhm robert, you probably got the problem's reason. those process were really ran as root. but maybe the following method can fix this too.

> Can you expand on this?

after a fork() if you call setpgrp() the process is converted to a process group, so on a kill() call all its childs are killed too.

you can also do it on qprocess' method: http://doc.trolltech.com/4.4/qprocess.html#setupChildProcess
Comment 4 Jekyll Wu 2011-10-03 06:31:53 UTC
Well, a bug report from 3 years ago :)

I do not fully understand the mentioned problem(how was powertop/iotop run as root?). Anyway, I just committed some code for closing konsole session in a more reliable way, which may be also of help to this problem. If the reporter is still watching this report, could you please check this problem using the git version[1]? If it still happens, could you provide concrete and clear steps to reproduce it?  

[1] http://quickgit.kde.org/?p=konsole.git&a=summary
Comment 5 Bráulio Barros de Oliveira 2011-10-07 19:33:44 UTC
I would mark this as solved; I'm using konsole on a daily basis and never had this problem again.

Thanks for the feedback!