Bug 420975 - The "System Settings" > "Startup and Shutdown" > "Autostart" > "Script File" does not get executed.
Summary: The "System Settings" > "Startup and Shutdown" > "Autostart" > "Script File" ...
Status: RESOLVED NOT A BUG
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_autostart (other bugs)
Version First Reported In: 5.18.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Laurent Montel
URL:
Keywords:
: 420976 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-05-04 02:43 UTC by remyvrs
Modified: 2020-05-11 16:29 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description remyvrs 2020-05-04 02:43:38 UTC
SUMMARY
The "System Settings" > "Startup and Shutdown" > "Autostart" > "Script File" does not get executed.

STEPS TO REPRODUCE
1. add and executable sh file in the "Script File" section
2. monitor for result 

OBSERVED RESULT
does not get any execution result 

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.18.4
KDE Frameworks Version: 5.68.0
Qt Version: Qt 5.12.8 (built against 5.12.8)

ADDITIONAL INFORMATION
Comment 1 remyvrs 2020-05-04 02:55:59 UTC
*** Bug 420976 has been marked as a duplicate of this bug. ***
Comment 2 Nate Graham 2020-05-07 14:59:37 UTC
Works for me. Can you make sure the script file is marked as executable?
Comment 3 remyvrs 2020-05-07 16:25:58 UTC
Hi, 
yes, the file is executable 

first of all I do not have a fresh install, I have upgraded from 18.04 and this is a setup that I previously had and it worked.
secondly, since it does not work automatically I am currently executing it manually, hoping that this would get fixed :)
Comment 4 Nate Graham 2020-05-07 17:13:52 UTC
Thanks for the info.
Comment 5 Méven Car 2020-05-11 13:18:51 UTC
I don't reproduce.

I tested also with the upcoming refactoring branch.

The script I added was :

cat ~/touch_desktop_file.sh :

  #!/bin/bash
  touch ~/Desktop/test

And could see a test file on my desktop after reboot

It may be a stupid question but, did you test your script manually ?

What returns ?
`ls -l ~/.config/autostart-scripts/`
It should contain a copy of your script or a link to it.
Comment 6 remyvrs 2020-05-11 14:46:12 UTC
HI,
actually it is not a stupid Q :)

But yes, as stated, since it is not executed automatically I run the script manually until the issue will get fixed. So, yes, the script runs OK.

I will get back with the other details..
Comment 7 remyvrs 2020-05-11 15:15:34 UTC
I've tried your script and it worked (got auto executed during start).
Turns out that the script must start with "#!/bin/bash" and my script didn't had that ... and all my other tries were without. 
This wasn't an issue before the upgrade from 18.04 to 20.04 .

Anyway, I have my solution now, at least for my case and I leave up to you the resolution for this issue.

Best Regards,
Remus
Comment 8 Méven Car 2020-05-11 16:29:30 UTC
(In reply to remyvrs from comment #7)
> I've tried your script and it worked (got auto executed during start).
> Turns out that the script must start with "#!/bin/bash" and my script didn't
> had that ... and all my other tries were without. 

I a feeling it could be this, it is the next classical issue after missing exec permission for script launches.

> This wasn't an issue before the upgrade from 18.04 to 20.04 .

I guess this changed due to the new startkde program introduced in 2018 that was responsible to speeding up the starting of plasma.
http://blog.davidedmundson.co.uk/blog/plasma-startup/

Not having a script env header is bad practice, the kind of stuff that will prevent your script to run in cron for instance.

> 
> Anyway, I have my solution now, at least for my case and I leave up to you
> the resolution for this issue.
> 

Since it was a misconfiguration, it is "Not a bug" IMO.

Maybe the kcm could help prevent such cases though.