Bug 370528 - Autostart, stderr is closed if daemonized (conky)
Summary: Autostart, stderr is closed if daemonized (conky)
Status: RESOLVED FIXED
Alias: None
Product: ksmserver
Classification: Plasma
Component: general (show other bugs)
Version: 5.8.0
Platform: Debian unstable Linux
: NOR minor
Target Milestone: ---
Assignee: Lubos Lunak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-12 08:12 UTC by Maximiliano Curia
Modified: 2017-04-21 12:03 UTC (History)
0 users

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 Maximiliano Curia 2016-10-12 08:12:39 UTC
This seems to be related to the move of the autostart code from klauncher to ksmserver.

Some programs expect a valid stderr (to send their errors to ~/.xsession-errors) even after daemonizing themselves.

Reports about this can be found:
 https://bbs.archlinux.org/viewtopic.php?id=217920
 https://bugs.debian.org/840478

Avoiding daemonization, or redirecting stderr solves the problem, but still plasma 5.8 breaks backwards compatibility with these programs.


Reproducible: Always

Steps to Reproduce:
1. Install conky
2. Add an autostart desktop file ~/.config/autostart/conky.desktop with:
 [Desktop Entry]
 Exec=/usr/bin/conky -d
 Icon=system-run
 Path=
 Terminal=false
 Type=application
3. Restart your session

Actual Results:  
conky is not running

Expected Results:  
conky is running

This worked fine with previous plasma versions.
Comment 2 Lubos Lunak 2017-04-21 12:03:11 UTC
Git commit 0f19e92f3e85d064de9cebf280fa8e085485c2e0 by Luboš Luňák.
Committed on 21/04/2017 at 11:59.
Pushed by lunakl into branch 'Plasma/5.8'.

launch autostart apps in ksmserver using KRun, not QProcess

The "move" (copy in fact) of the autostart code from klauncher simply
switched to QProcess. This resulted in a number of problems, as the incorrect
handling of .desktop file command if it had placeholders (worked around
already), kdeinit is no longer used (not sure how much that matters nowadays)
and finally QProcess simply eats all stdout/stderr of all such processes
(which, when daemonized, can lead even to the processes getting SIGPIPE'd).
If the application to start is a KService, simply launch it as such.
Related: bug 369391

M  +3    -13   ksmserver/startup.cpp

https://commits.kde.org/plasma-workspace/0f19e92f3e85d064de9cebf280fa8e085485c2e0
Comment 3 Lubos Lunak 2017-04-21 12:03:31 UTC
Git commit da44dd6eae8b9ef4161680efcb9319a7267fe77e by Luboš Luňák.
Committed on 21/04/2017 at 12:00.
Pushed by lunakl into branch 'Plasma/5.9'.

launch autostart apps in ksmserver using KRun, not QProcess

The "move" (copy in fact) of the autostart code from klauncher simply
switched to QProcess. This resulted in a number of problems, as the incorrect
handling of .desktop file command if it had placeholders (worked around
already), kdeinit is no longer used (not sure how much that matters nowadays)
and finally QProcess simply eats all stdout/stderr of all such processes
(which, when daemonized, can lead even to the processes getting SIGPIPE'd).
If the application to start is a KService, simply launch it as such.
Related: bug 369391

M  +3    -13   ksmserver/startup.cpp

https://commits.kde.org/plasma-workspace/da44dd6eae8b9ef4161680efcb9319a7267fe77e
Comment 4 Lubos Lunak 2017-04-21 12:03:32 UTC
Git commit c7d21ae2b834bd101d8dba1edaea05edcdb6e8f5 by Luboš Luňák.
Committed on 21/04/2017 at 12:00.
Pushed by lunakl into branch 'Plasma/5.9'.

use KProcess instead of QProcess to launch apps in ksmserver

Follow-up to the previous commit. KProcess has saner defaults for simply
launching an app and being done with it, no lost stdout/stderr or even SIGPIPE.
Related: bug 369391

M  +3    -2    ksmserver/startup.cpp

https://commits.kde.org/plasma-workspace/c7d21ae2b834bd101d8dba1edaea05edcdb6e8f5