Bug 389005 - Startup & Shutdown scripts not working
Summary: Startup & Shutdown scripts not working
Status: RESOLVED WORKSFORME
Alias: None
Product: ksmserver
Classification: Unmaintained
Component: general (show other bugs)
Version: 5.11.5
Platform: openSUSE Linux
: NOR major
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-15 13:31 UTC by BingMyBong
Modified: 2018-01-25 11:03 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
xsession-errors after login (21.46 KB, text/plain)
2018-01-18 12:44 UTC, BingMyBong
Details
org-session.log for sddm session (24.50 KB, text/x-log)
2018-01-19 19:25 UTC, BingMyBong
Details
xsession errors for kdm login autostart issue (21.88 KB, text/plain)
2018-01-25 10:47 UTC, BingMyBong
Details

Note You need to log in before you can comment on or make changes to this bug.
Description BingMyBong 2018-01-15 13:31:23 UTC
Scripts configured to run at startup and logoff are to being executed at all.  The last time my backup script ran during logoff on my machine was 29 Dec 2017 - can't confirm when startup script stopped working as i have run it manually a couple of times.

opensuse:tumbleweed:20180110
Qt: 5.10.0 KDE Frameworks: 5.41.0 - KDE Plasma:  5.11.5 - kwin 5.11.5
kmail2 5.7.0 - akonadiserver 5.7.0 - Kernel:  4.14.12-1-default
Comment 1 BingMyBong 2018-01-18 11:33:20 UTC
Updated to redirect bug to Plasma/kcm_kded - hopefully in the correct place
Comment 2 BingMyBong 2018-01-18 11:34:39 UTC
(In reply to BingMyBong from comment #1)
> Updated to redirect bug to Plasma/kcm_kded - hopefully in the correct place

Tracker didn't like that change, had to make it plasmashell/general
Comment 3 David Edmundson 2018-01-18 11:43:26 UTC
Please confirm it's not your script by adding:

#!/bin/sh
echo foo > /tmp/myScriptHasRan

make sure this script is readable and executable by your user



Also please check ~/.xsession-errors OR ~/.local/share/sddm/xorg-sessino.log for any output. 

Autostart scripts should print a line

"Starting autostart script " << fullPath;
Comment 4 BingMyBong 2018-01-18 12:17:13 UTC
(In reply to David Edmundson from comment #3)
> Please confirm it's not your script by adding:
> 
> #!/bin/sh
> echo foo > /tmp/myScriptHasRan


These are the first 3 lines of the login script 
echo "working" > SIGNATURE-WORKING
a=$(cat /etc/os-release | grep "CPE_NAME" | cut -b 18-45)
echo $a >RELEASE_LEVELS

It works fine when run from the cli but i do get these 3 errors displayed
libGL error: unable to load driver: nouveau_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: nouveau

> 
> make sure this script is readable and executable by your user
-rwxr--r-- 1 is users 569 Jan 18 12:10 signature.sh

> 
> Also please check ~/.xsession-errors OR ~/.local/share/sddm/xorg-sessino.log
> for any output. 

i'm using kdm

> Autostart scripts should print a line
> 
> "Starting autostart script " << fullPath;

These lines are in ~/.xsession-errors although systemsettings5 is configured to use "/home/is/signature.sh"
ksmserver: Starting autostart script  "/home/is/.config/autostart-scripts/signature.sh"
ksmserver: Starting notification thread

I added the same echo to a file with my logout script to make sure that worked manually too. 
These script files had been working for over a year quite happily.
Comment 5 BingMyBong 2018-01-18 12:44:19 UTC
Created attachment 109967 [details]
xsession-errors after login

a copy of the xsession-errors file just after login and then run cli
Comment 6 BingMyBong 2018-01-19 19:23:24 UTC
I changed to sddm and the scripts still do not run - see attached log for sddm
Comment 7 BingMyBong 2018-01-19 19:25:37 UTC
Created attachment 109999 [details]
org-session.log for sddm session

Log of sddm login session shows "signature.sh" script is accessed but it does not run and no error logged
Comment 8 kafei 2018-01-25 02:25:02 UTC
BingMyBong, do you have "#!/bin/sh" at the start of your script? My startup script also stopped working last month, and after adding "#!/bin/sh" it started running during startup again.

Though I wonder why that wasn't necessary before.
Comment 9 BingMyBong 2018-01-25 10:38:01 UTC
(In reply to kafei from comment #8)
> BingMyBong, do you have "#!/bin/sh" at the start of your script? My startup
> script also stopped working last month, and after adding "#!/bin/sh" it
> started running during startup again.
> 
> Though I wonder why that wasn't necessary before.

No, I didn't.  I added to both my startup and logout script but only the logout script worked.
Thanks.
Comment 10 BingMyBong 2018-01-25 10:46:01 UTC
(In reply to David Edmundson from comment #3)
> Please confirm it's not your script by adding:
> 
> #!/bin/sh
> echo foo > /tmp/myScriptHasRan
> 
> make sure this script is readable and executable by your user
> 
> 
> 
> Also please check ~/.xsession-errors OR ~/.local/share/sddm/xorg-sessino.log
> for any output. 
> 
> Autostart scripts should print a line
> 
> "Starting autostart script " << fullPath;

I've now added "#!/bin/sh" to both startup and logout scripts but it only makes the logout script work.  
I originally only tried it with the startup script and that didn;t work so i mistakenly assumed it wouldn't work with the logout script.
I'll add the latest .xsession-errors file
Comment 11 BingMyBong 2018-01-25 10:47:24 UTC
Created attachment 110112 [details]
xsession errors for kdm login autostart issue
Comment 12 BingMyBong 2018-01-25 11:02:41 UTC
oh balls...  
I had a blank line in the startup script before the "#!/bin/sh" and that stopped it working.
It works fine now.  I'll close this bug