PDA

View Full Version : kdesu in a kprocess - cant be killed



soul_rebel
24th March 2006, 00:49
well the title really says it all.
i have a kprocess that runs a command that starts with "kdesu -t -c" so that it runs as root; the problem is if i sigkill sigterm or sigint the process only the kdesu instance gets killed, not what it actually does.
this happens although i start the process is runmode "OwnGroup" which means
OwnGroup -- like NotifyOnExit, but the child process is started in an own process group (and an own session, FWIW). The behavior of kill() changes to killing the whole process group - this makes this mode useful for implementing primitive job management. It can be used to work around broken wrapper scripts that don't propagate signals to the "real" program. However, use this with care, as you disturb the shell's job management if your program is started from the command line doesnt the documentation claim that OwnGroup does exactly what i need it to?
why does it not do it?
thanks for any help!

jacek
24th March 2006, 01:07
why does it not do it?
Maybe because normal users can't kill processes owned by root?

soul_rebel
24th March 2006, 12:12
Maybe because normal users can't kill processes owned by root? but shouldnt kdesu do a proper job-handling and term its children when it is terminated itself?
how would i kill the process then? i dont want to run the entire app as root because i dont like giving root permissions to anything more than necessary -> not to the gui.
i have looked into KDEsuClient but i dont think it can help me...
is there way run part of the program with different previliges than the rest? (kProcess only offers you to drop previliges not to to assume more)

when using suid apps one can use the difference between User ID and Effective User ID to do this (after starting the program seteuid to getuid and seteuid to 0 whenever a line of code has to be run as root, than back again), but when using kdesu both the real and the effective user id for the child process are 0....
thanks for any help!

jacek
24th March 2006, 22:54
Does it behave in the same way when you start kdesu from the console?

soul_rebel
25th March 2006, 00:08
yes sigint or killing from konsole doesnt stop child process either...