Bug 349480 - startkde shutdown scripts code is broken
Summary: startkde shutdown scripts code is broken
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_autostart (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR major
Target Milestone: ---
Assignee: Laurent Montel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-22 00:30 UTC by Ivan Adzhubey
Modified: 2015-08-20 14:40 UTC (History)
1 user (show)

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 Ivan Adzhubey 2015-06-22 00:30:07 UTC
The following code at the bottom of /usr/bin/startkde script is broken:

# Run scripts found in <config locations>/plasma-workspace/shutdown
for prefix in `echo "$scriptpath"`; do
  for file in `ls "$prefix"/shutdown 2> /dev/null | egrep -v '(~|\.bak)$'`; do
    test -x "$prefix$file" && "$prefix$file"
  done
done

The "$prefix$file" variables expand to something like "$HOME/.config/plasma-workspacescriptname.sh" which is NOT what we want, so the test -x inside the loop will always fail and no shutdown scripts executed ever.

Should be replaced with something like the following:

# Run scripts found in <config locations>/plasma-workspace/shutdown
for prefix in `echo "$scriptpath"`; do
  shutdown_path="$prefix/shutdown"
  for file in `ls "$shutdown_path" 2>/dev/null | egrep -v '(~|\.bak)$'`; do
    test -x "$shutdown_path/$file" && "$shutdown_path/$file"
  done
done


Reproducible: Always

Steps to Reproduce:
1. Copy any executable script into $HOME/.config/plasma-workspace/shutdown/
2. Logout from KDE
3. Script will NOT execute
Comment 1 David Edmundson 2015-08-20 14:38:17 UTC

*** This bug has been marked as a duplicate of bug 346862 ***
Comment 2 David Edmundson 2015-08-20 14:38:34 UTC
oh wait
sorry. I misread this
Comment 3 David Edmundson 2015-08-20 14:40:40 UTC
This has been fixed in 5.4. Sorry we missed this for so long :S

See 96fdec6734087e54c5eee7c073b6328b6d602b8e of plasma-workspace

In future if you have patches, please upload to git.reviewboard.kde.org