<div dir="ltr"><div dir="ltr">On Sun, Jan 30, 2022 at 5:54 AM Mantas Mikulėnas <<a href="mailto:grawity@gmail.com">grawity@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Sat, Jan 29, 2022 at 5:29 AM Raman Gupta <<a href="mailto:rocketraman@gmail.com" target="_blank">rocketraman@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Try to set the systemd user instance's log level to 'debug'; I'm guessing it's not that systemd kills processes directly but that something triggers a 'systemctl stop' of the session .scope that they were in.</blockquote><div><br></div><div>Here are the logs at debug level with some annotations inline:</div><div><br></div><div><b>...</b></div></div></blockquote><div><br></div><div>Processes get SIGCHLD for all children that exit -- it's not suppressed just because the same process sent a SIGTERM recently.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br>...</div></div></blockquote><div><br></div><div>Honestly this just sounds like systemd killing "leftover" processes within the plasma-plasmashell cgroup, after the "main" process of that service has exited. That's not a bug; that's standard behavior for systemd services.</div></div></div></blockquote><div><br></div><div>What determines whether a process becomes part of the plasma-plasmashell cgroup or not? When I run plasmashell independently of systemd, processes do indeed start as child processes of plasmashell. I'm guessing this implies that when plasmashell is run under systemd, all these processes become part of the cgroup, and this is why systemd "cleans up" all these child processes after a plasmashell crash?</div><div><br></div><div>It's also interesting to me that many applications *do not* exit in this scenario -- Slack Desktop exits about 50% of the time, and IDEA exits pretty consistently. Most other apps remain running. Not sure why that would be -- if systemd is cleaning up, shouldn't all apps exit?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><br></div><div>For special cases like desktop environments, I think this means the .service should have KillMode=process (as long as that's still supported, anyway), *or* Plasma should be improved to no longer spawn apps directly but to put them in new systemd units (like gnome-shell does).</div></div></div></blockquote><div><br></div><div>Makes sense. If I have time, I'll follow up with Plasma upstream regarding this. I do want to make sure I understand what is going on though, so I can file a good report.</div><div><br></div><div>Regards,</div><div>Raman</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div>-- <br><div dir="ltr"><div dir="ltr">Mantas Mikulėnas</div></div></div>
</blockquote></div></div>