Bug 352491

Summary: startkde fails silently upon script error in ~/.config/plasma-workspace/env
Product: [Plasma] plasmashell Reporter: Steven Franzen <sfranzen85>
Component: generalAssignee: David Edmundson <kde>
Status: RESOLVED FIXED    
Severity: normal CC: bhush94, lbeltrame, Martin, plasma-bugs, rdieter
Priority: NOR    
Version: 5.4.0   
Target Milestone: 1.0   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: .xsession-errors
The offending script

Description Steven Franzen 2015-09-09 18:10:14 UTC
I had a script residing in the mentioned directory to set some environment variables for Intel compilers. It did this by calling a script in the compiler directory with the right arguments. After uninstalling these compilers, this script was obviously no longer present, and I could no longer seem to start a Plasma session.

Reproducible: Always

Steps to Reproduce:
1. Have a script in ~/.config/plasma-workspace/env referencing a non-existent file.
2. Attempt to start a Plasma session.

Actual Results:  
Splash screen displays (if enabled), but progress bar does not fill. Otherwise a black screen with the mouse cursor.

Expected Results:  
The desktop session is started as expected.
Comment 1 Steven Franzen 2015-09-09 18:12:01 UTC
Created attachment 94491 [details]
.xsession-errors

The only contents of .xsession-errors upon encountering the bug.
Comment 2 Luca Beltrame 2015-09-10 07:28:29 UTC
If you have the contents of the script handy, it would be good to have it here for testing.
Comment 3 Steven Franzen 2015-09-10 11:52:14 UTC
Created attachment 94495 [details]
The offending script

This is the offending part from the script.
Comment 4 David Edmundson 2015-09-20 15:59:20 UTC
Git commit 2870b5e69bf892c3d08df2d8ee11491542e0d796 by David Edmundson, on behalf of Steven Franzen.
Committed on 20/09/2015 at 15:58.
Pushed by davidedmundson into branch 'Plasma/5.4'.

Continue even if script returns errors

/bin/sh stops execution upon finding a nonzero exit code,
which means that startkde will not continue if a script in
.config/plasma-workspace/env/ produces an error.

This small fix will execute a no-op in such a case,
so that errors will not affect startkde's progress,
while still being visible in .xsession-errors.

REVIEW: 125323

M  +1    -1    startkde/startkde.cmake

http://commits.kde.org/plasma-workspace/2870b5e69bf892c3d08df2d8ee11491542e0d796
Comment 5 Rex Dieter 2015-10-06 01:31:53 UTC
This fix broke env processing for us (fedora),  source'ing the items in subshell means the environment changes cannot propogate to the parent shell.
Comment 6 Martin Steigerwald 2015-10-10 12:59:42 UTC
I can confirm this. Reopening.
Comment 8 Martin Steigerwald 2015-10-10 13:15:10 UTC
Thanks, Bhushan. Confirmed that fix works in Debian Sid with dash as system shell.