Summary: | ApplicationLaunchJob should give each launched app its own labelled systemd-journald stream | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | Simon McVittie <smcv> |
Component: | general | Assignee: | KIO Bugs <kio-bugs-null> |
Status: | CONFIRMED --- | ||
Severity: | wishlist | CC: | kde, kdelibs-bugs, mss, nate |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Simon McVittie
2022-11-01 13:12:35 UTC
Note that steam.sh explicitly logs its own name and pid in each message, to make its messages easier to identify/attribute, which is where the `steam.sh[12345]` in my examples comes from. If an app is writing random unattributed debug messages to stdout/stderr with no particular markers, then they'll look more like the `Installing breakpad exception handler blah blah blah` lines in my examples. The behaviour I'm asking for becomes particularly useful in this case. FWIW, there is a mechanism that exists now: exporting KDE_APPLICATIONS_AS_SERVICE=1 It's an alternative launching process in which we tell systemd to run our application, rather than us forking+exec'ing. Journald handling would then be resolved completely implicitly. It's currently not default due to upstream changes being needed which we couldn't rely on at a KDE level. It might be worth revisiting that. A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1019 If plasmashell (and presumably other ApplicationLaunchJob users) ends up exclusively using the transient service code path, then yes that would address this request. GLib/GNOME has been trying to do something similar, but the people implementing it seem to have run into a lot of practical problems (perhaps the relevant GLib APIs expose more implementation details to the app than their KDE equivalents, making a change of implementation more likely to break things?), so we weren't able to switch over to transient services everywhere, and the stream-fd-based approach that I suggested here gave existing apps a small incremental improvement. Git commit 5c0ce0f5882d732578be22ac6bb7e1d250e2046b by David Edmundson. Committed on 31/03/2023 at 14:19. Pushed by davidedmundson into branch 'master'. Set ExitType when running applications as transient systemd services KIO internally has 3 paths to launch applications. - fork and exec - fork and exec then put in a "scope" so that we have our own cgroup (default) - asking systemd to launch the application The latter was explicitly disabled by default because we had some issues with applications being cleaned up when the first process exited. We made those upstream changes a year ago, but haven't adopted the changes here. This brings it in line with the setup used by xdg-autostart-generator. Nothing will change when we land this as this operation mode is not enabled. Related: bug 423756 M +13 -11 src/gui/systemd/systemdprocessrunner.cpp https://invent.kde.org/frameworks/kio/commit/5c0ce0f5882d732578be22ac6bb7e1d250e2046b A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1244 Git commit 0c540119248c1eb373eaf2ee323094798897967a by David Edmundson. Committed on 03/04/2023 at 08:44. Pushed by davidedmundson into branch 'kf5'. Set ExitType when running applications as transient systemd services KIO internally has 3 paths to launch applications. - fork and exec - fork and exec then put in a "scope" so that we have our own cgroup (default) - asking systemd to launch the application The latter was explicitly disabled by default because we had some issues with applications being cleaned up when the first process exited. We made those upstream changes a year ago, but haven't adopted the changes here. This brings it in line with the setup used by xdg-autostart-generator. Nothing will change when we land this as this operation mode is not enabled. Related: bug 423756 (cherry picked from commit 5c0ce0f5882d732578be22ac6bb7e1d250e2046b) M +13 -11 src/gui/systemd/systemdprocessrunner.cpp https://invent.kde.org/frameworks/kio/commit/0c540119248c1eb373eaf2ee323094798897967a |