Bug 434887 - Helper processes get reparented to init, making it hard to identify kde's components in the running session.
Summary: Helper processes get reparented to init, making it hard to identify kde's com...
Status: RESOLVED UNMAINTAINED
Alias: None
Product: frameworks-kinit
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.80.0
Platform: Slackware Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-24 14:48 UTC by lockywolf
Modified: 2023-07-03 21:09 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lockywolf 2021-03-24 14:48:38 UTC
SUMMARY

In the traditional UNIX system, processes are arranged in a nice process tree, where each child belongs to a single parent, usually the process which launched the child, thus the process namespace is well structured, and debugging where unexpected processes are coming from is easy.

However, for some reason, kde's processes get reparented to pid 1, losing this tree-based sturecture, getting scattered all over the root process namespace, which makes debugging unexpected system behaviour very hard.

I am using xfce daily, however, as no DE can be providing applications for all tasks that a user may need, I am ending up using KDE's applications occasionally. However, launching certain KDE applications (okular in particular) leads to the whole kde session being started (quite unexpectedly), and what is more, the helper processes launched by the kde session manager are not being killed after the original application is terminated, but instead continue running and interfering with the similar-purpose processes from xfce (and others).

What is worse, not being an expert in kde makes it very hard to identify those processes and terminate them manually, since, as mentioned above, the processes are not arranged in a nice process tree for some reason, but rather scattered all over the pid 1 namespace.

Please, consider reverting to the traditional UNIX behaviour.

(There may be one case when this behaviour is suboptimal, namely, when kdeinit is launched as a service from systemd (that is when kde is running as the primary DE), and kdeinit suddenly dies, the rest of the tree would be killed by systemd. However, systemd developers knew about such a use-case, and provide the KillMode=process option for such kind of services (units). Therefore, systemd-based systems should not be affected by reverting to the traditional semantics.)

STEPS TO REPRODUCE
1. run xfce
2. launch any application that would require to start kdeinit
3. run pstree to see the processes launched by kdeinit being the adopted children of pid 1

OBSERVED RESULT

Processes launched by kdeinit are the children of pid 1, as displayed by pstree.

EXPECTED RESULT

Processes launched by kdeinit are the children of kdeinit, as displayed by pstree.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.80.0
(available in About System)
KDE Plasma Version: 5.21
KDE Frameworks Version: 5.80.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Nicolas Fella 2021-03-24 18:27:53 UTC
Can you please clarify what you mean with "leads to the whole kde session being started" ?
Comment 2 lockywolf 2021-03-25 01:28:59 UTC
(In reply to Nicolas Fella from comment #1)
> Can you please clarify what you mean with "leads to the whole kde session
> being started" ?

That's the point of this issue. I cannot tell which parts of kde are launched, since they are all reparented to init, and I cannot identify which ones belong to kde, and which ones had been there before.
Comment 3 Christoph Cullmann 2023-07-03 21:09:59 UTC
kinit is removed for the upcoming kf6, beside critical fixes nothing will be done in the kf5 branch.