Bug 481278 - Autostart apps only after network target is reached
Summary: Autostart apps only after network target is reached
Status: CLOSED INTENTIONAL
Alias: None
Product: plasmashell
Classification: Plasma
Component: Startup process (show other bugs)
Version: 6.1.5
Platform: unspecified Linux
: NOR wishlist
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: junior-jobs
: 467619 481428 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-02-12 19:36 UTC by siavosh.kasravi
Modified: 2024-10-01 17:24 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description siavosh.kasravi 2024-02-12 19:36:37 UTC
It seem essential to be able to delay startup of apps mostly for two reasons:
1. Give resources to more important startup tasks.
2. Wait for depended apps to start first.

In my case it is essential to wait for network to get connected (which takes a while) before starting some apps. Starting those apps sooner puts them in a bad state and consumes extra resources as they are trying to connect to internet.

Generalizing this idea, it would have been nice to be able to run a zsh/bash a script as pre-run and  use its result as a flag to start up app or not. For example to delay start we could simply put it this way:
'sleep 3'

If we wanted to run an app if a file exists:
'[[ -f /some/file.flag ]] && return 0'

I believe this is fairly simple to implement while providing a huge amount of flexibility. We can even have 2 or 3 snippets for the most useful scripts like delay.
Comment 1 Nate Graham 2024-02-14 19:36:04 UTC
This isn't something we plan to do, as it amounts to leaving in known bugs and making expert users fix them themselves. Ideally, autostart apps should delay themselves automatically in response to these kinds of conditions, and that's what we aspire to.

So I'm going to close this as RESOLVED INTENTIONAL, but please do feel free to submit new bug reports that are reporting the specific bugs you're experiencing that led you to the conclusion that you want a manual delay setting. And we can investigate and fix those bugs for everyone, so no one needs any manual workarounds. :) Thanks!
Comment 2 siavosh.kasravi 2024-09-23 07:33:44 UTC
Autostart apps will delay and retry usually but it slows down startup as they all try to do the impossible at the same time. KDE can at least check if the network is connected then autostart apps.
Comment 3 Nate Graham 2024-09-23 13:31:14 UTC
We could, but that's a different request from what this bug report requests, which is a user-configurable delay setting. That's the thing that's been rejected and is not going to happen. Please open a new bug report about the specific issue of apps autostarting before the network is up and running, which we may be able to fix specifically without having to add user-configurability for it. Then put it in the "See Also" field of Bug 323151. Thanks!
Comment 4 siavosh.kasravi 2024-09-24 06:30:20 UTC
What you suggested is one approach for a solution to the problem. Still the problem is  what I presented in the original comment: "In my case it is essential to wait for network to get connected (which takes a while) before starting some apps. Starting those apps sooner puts them in a bad state and consumes extra resources as they are trying to connect to internet.".

It seems redundant to open another ticket for the same problem.
Comment 5 Nate Graham 2024-09-24 11:56:45 UTC
Ok, we can use the bug report to track only that.
Comment 6 David Edmundson 2024-09-30 14:49:25 UTC
>Starting those apps sooner puts them in a bad state and consumes extra resources as they are trying to connect to internet.".

That is a problem for those apps
Comment 7 David Edmundson 2024-09-30 14:49:50 UTC
>Starting those apps sooner puts them in a bad state and consumes extra resources as they are trying to connect to internet.".

That is a problem for those apps
Comment 8 David Edmundson 2024-09-30 15:01:48 UTC
You can also bring your network connection earlier by selecting "All users my connect to this network" and "Store password for all users" if applicable.
Comment 9 Nate Graham 2024-10-01 17:23:24 UTC
*** Bug 467619 has been marked as a duplicate of this bug. ***
Comment 10 Nate Graham 2024-10-01 17:23:32 UTC
*** Bug 481428 has been marked as a duplicate of this bug. ***