Bug 473089 - Login scripts (bash scrips) not working any more
Summary: Login scripts (bash scrips) not working any more
Status: RESOLVED NOT A BUG
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-07 05:47 UTC by office
Modified: 2023-08-11 16:57 UTC (History)
1 user (show)

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


Attachments
attachment-1156634-0.html (5.66 KB, text/html)
2023-08-10 08:54 UTC, office
Details

Note You need to log in before you can comment on or make changes to this bug.
Description office 2023-08-07 05:47:22 UTC
SUMMARY
Since upgrading from openSUSE Leap 15.4 -> Leap 15.5  execution of scripts (namely Login Scripts) is not working any more!
I use scripts to fire up several programs ina specific order. So I used all time a canonical script (Running once and ending) to do that.
I was able to find out the following:
The script IS running and it does all things I coded. But when this script reaches the end (and exits), all launched programs are killed.

STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT
Programs launched by a bash script in Login-script vanish (are killed) when related script ends. This was not the case in earlier KDE versions up to Leap 15.4.

EXPECTED RESULT
Same behavior as in Leap 15.4 and earlier.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma:  openSUSE Leap 15.5
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2023-08-07 21:43:09 UTC
I'm afraid this is due to an intentional change in how startup scripts are evaluated. So you'll have to change something about your setup here. You can either launch your apps using the supported method (as autostart apps, not from a script) or you can fork and detach when you launch the apps from the script.
Comment 2 office 2023-08-08 06:45:17 UTC
Hi, Nate.

This war then a very stupid decision in KDE development, changing such mechanisms, as this breaks many(!) 3rd party applications.

Skype for Linux .... 
Uses a shell script to start up.   When selecting  "[Menu] -> Internet -> Skype" in KDE Settings -> Start -> Autostart, exactly this script is called.   This works in KDE when I manually click that menu entry,  but it does not from Autostart ????    A very poor decision to change KDE to not support this any more.  I would recommend to add something in Autostart config, allowing to re-enable previous behavior.

Here the original startup script /usr/bin/skypeforlinux ......
#!/bin/sh
SCRIPT=$(readlink -f "$0")
USR_DIRECTORY=$(readlink -f $(dirname $SCRIPT)/..)
SKYPE_PATH="$USR_DIRECTORY/share/skypeforlinux/skypeforlinux"
SKYPE_LOGS="$HOME/.config/skypeforlinux/logs"
mkdir -p $SKYPE_LOGS
nohup "$SKYPE_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$SKYPE_LOGS/skype-startup.log" 2>&1 &

WATCH LAST LINE !   All programs started with trailing '&'  abort when the script ends.



Same with other programs!
Comment 3 office 2023-08-08 07:38:05 UTC
In point of this automating things I would recommend following things:

1.  Option for enabling former behavior (allowing canonical scripts)
If this is not desired by default, it should still be made possible to get that back. It breaks any (older) software if that is not made possible! 

2. Allow entering a "delay before execution" for every entry in autostart.  
This allows to establish a startup order of programs, a very valuable feature because you can avoid race conditions and also start not important things later. Reduces also system load.

3. Option for some kind of "kde-cron".  
Allow KDE to do scheduled things as cron does on system level
Comment 4 Nate Graham 2023-08-08 20:16:25 UTC
If you're having trouble adjusting to the new system, I'd recommend asking for help at https://discuss.kde.org/c/help/6. I'd also recommend trying to avoid insulting people or their decisions; this tends to make them not want to help you.

An alternative course of action is to revert to the old system. You can do this by entering `kwriteconfig5 --file startkderc --group General --key systemdBoot false` in a terminal window and rebooting.

Note that this will disable multiple Plasma features that depend on it, and the old system may be removed in the future--at this point you'd have to change things to adjust to it anyway. So I would strongly recommend adjusting to it, and seeking help at https://discuss.kde.org/c/help/6 as needed.
Comment 5 office 2023-08-10 08:54:10 UTC
Created attachment 160883 [details]
attachment-1156634-0.html

Well,

thank you for providing the reverting to old system by entering
`kwriteconfig5 --file startkderc --group General --key systemdBoot false".

How do I make this change undone (get back to current startup) ?  I only guess (but need 
confirmation. Is it
`kwriteconfig5 --file startkderc --group General --key systemdBoot true"  ???


Actually I have no problems with internal changes, *as long as they do not break 
compatibility and function*. This is also named backwards compatibility.
This change to systemdBoot definitely violates backwards compatibility. Either a way for 
correctly implementing support for canonical startup scrips is necessary, or  keeping the old 
startup way must be kept available.


Is there a command available that can be placed at the end of a canonical script, blocking 
the script there until KDE shuts down, without consuming CPU time?  This way I could stay 
on new systemd based startup and will get thesame result, the script did its job and all 
childs are alive.






Am Dienstag, 8. August 2023, 22:16:25 CEST schrieben Sie:
> https://bugs.kde.org/show_bug.cgi?id=473089
> 
> --- Comment #4 from Nate Graham <nate@kde.org> ---
> If you're having trouble adjusting to the new system, I'd recommend asking
> for help at https://discuss.kde.org/c/help/6. I'd also recommend trying to
> avoid insulting people or their decisions; this tends to make them not want
> to help you.
> 
> An alternative course of action is to revert to the old system. You can do
> this by entering `kwriteconfig5 --file startkderc --group General --key
> systemdBoot false` in a terminal window and rebooting.
> 
> Note that this will disable multiple Plasma features that depend on it, and
> the old system may be removed in the future--at this point you'd have to
> change things to adjust to it anyway. So I would strongly recommend
> adjusting to it, and seeking help at https://discuss.kde.org/c/help/6 as
> needed.
Comment 6 Nate Graham 2023-08-11 16:57:47 UTC
(In reply to office from comment #5)
> How do I make this change undone (get back to current startup) ?  I only
> guess (but need 
> confirmation. Is it
> `kwriteconfig5 --file startkderc --group General --key systemdBoot true"  ???
That's correct.

> Is there a command available that can be placed at the end of a canonical
> script, blocking 
> the script there until KDE shuts down, without consuming CPU time?  This way
> I could stay 
> on new systemd based startup and will get thesame result, the script did its
> job and all 
> childs are alive.
Yes, there are ways to do this, but providing support for that is out of scope for what we can do on the bug tracker. Allow me to once again suggest asking on https://discuss.kde.org/c/help/6.