Page 1 of 2

How to delay startup of an application? [Solved]

Posted: Tue Jun 18, 2019 1:54 pm
by Crippled
I have asked this in other forums without any luck. :( The icon in the panel from Astrill VPN shows up very tiny at times right after boot up due to it starting too soon. How do I delay the auto-start of Astrill VPN? :?

Re: How to delay startup of an application?

Posted: Tue Jun 18, 2019 3:17 pm
by MrEen
Most likely something similar to how I start Conky with a delay. In Menu > Settings > Session and Startup > Application Autostart tab, click on the item then click on Edit. Here's the Command I have for Conky: sh -c "sleep 20 && conky"

Re: How to delay startup of an application?

Posted: Tue Jun 18, 2019 3:22 pm
by Crippled
:? How would I do this? "/usr/local/Astrill/astrill" /autostart

Re: How to delay startup of an application?

Posted: Tue Jun 18, 2019 3:27 pm
by MrEen
I'm not sure. I'd rather not guess at the syntax in this case with the command already needing quotes. I'm sure someone else will be able solve it.

Re: How to delay startup of an application?

Posted: Wed Jun 19, 2019 2:11 pm
by secureIT
Hi Crippled,

first: please let us know :

did you try the last suggestion from your thread in MX-Forum ? ….. as you did not answerded it ?

http://mxlinux.org/forum/viewtopic.php? ... 55&p=48059

Re: How to delay startup of an application?

Posted: Wed Jun 19, 2019 2:20 pm
by Crippled
secureIT wrote:
Wed Jun 19, 2019 2:11 pm
Hi Crippled,

first: please let us know :

did you try the last suggestion from your thread in MX-Forum ? ….. as you did not answerded it ?

http://mxlinux.org/forum/viewtopic.php? ... 55&p=48059
That didn't work.

Re: How to delay startup of an application?

Posted: Wed Jun 19, 2019 2:51 pm
by secureIT
Thank you for the response.
So now let us try further solutions.
I think that:
"/usr/local/Astrill/astrill" /autostart
is the command in autostart.
Is that right ?

If, then lets try something :
1. Go to graphical settings menu >session and startup behavior > automatically launched applications ......
and take the hook out of astrill.
2. restart

3. Open up a terminal and copy this to it .... then press return key :

Code: Select all

#!/bin/bash
(sleep 20s && /usr/local/Astrill/astrill) &
.............and tell us. if that works (but be patient for 20 secs) :)

Re: How to delay startup of an application?

Posted: Wed Jun 19, 2019 2:58 pm
by Crippled
Yes, "/usr/local/Astrill/astrill" /autostart is the command out of Application Autostart. hook? :? What do you mean by "hook?"

Re: How to delay startup of an application?

Posted: Wed Jun 19, 2019 3:05 pm
by secureIT
simply disable it ..........
edit:
hook is set : ..... enabled
click on the hook ..... it disappears and the autostart of this app is disabled .......
You find the "hooks" into the front menu of autostart applications

Re: How to delay startup of an application?

Posted: Wed Jun 19, 2019 3:18 pm
by Gruppo Sportivo
Where is the file or package Astrill Client been installed,probably i guess in the directory /opt

Go to graphical settings menu<->preferences <->startup applications,add a starter named AstrillVpn and edit the delay time.

Startup application command may look something like this /opt/astrilvpn/bin/astrill-client --quiet

Re: How to delay startup of an application?

Posted: Wed Jun 19, 2019 3:28 pm
by Crippled
secureIT wrote:
Wed Jun 19, 2019 3:05 pm
simply disable it ..........
edit:
hook is set : ..... enabled
click on the hook ..... it disappears and the autostart of this app is disabled .......
You find the "hooks" into the front menu of autostart applications
It started but I got this error. I am going to do a re-boot to see how it starts. $ /bin/sh: 1: nscd: not found
An unhandled exception occurred at $000000000042BF25:
EOSError: Failed to execute "/bin/sh", error code: 127
$000000000042BF25

Re: How to delay startup of an application?

Posted: Wed Jun 19, 2019 3:38 pm
by Crippled
secureIT wrote:
Wed Jun 19, 2019 3:05 pm
simply disable it ..........
edit:
hook is set : ..... enabled
click on the hook ..... it disappears and the autostart of this app is disabled .......
You find the "hooks" into the front menu of autostart applications
Your way didn't work.

Re: How to delay startup of an application?

Posted: Wed Jun 19, 2019 3:42 pm
by MrEen
Just to be sure, see if this does it: Menu > Settings > Session and Startup > Application Autostart tab, click on the item then click on Edit. Change the command to sleep 20 && /usr/local/Astrill/astrill /autostart

Re: How to delay startup of an application?

Posted: Wed Jun 19, 2019 3:42 pm
by Crippled
Gruppo Sportivo wrote:
Wed Jun 19, 2019 3:18 pm
Where is the file or package Astrill Client been installed,probably i guess in the directory /opt

Go to graphical settings menu<->preferences <->startup applications,add a starter named AstrillVpn and edit the delay time.

Startup application command may look something like this /opt/astrilvpn/bin/astrill-client --quiet
It's not in opt. In Application Autostart I have for Astrill this command. "/usr/local/Astrill/astrill" /autostart How do I add 20 seconds to it?

Re: How to delay startup of an application?

Posted: Wed Jun 19, 2019 3:44 pm
by secureIT
if the error occurs after restart ...... next try will be :

Code: Select all

#!/bin/bash
sleep 20s && /usr/local/Astrill/astrill
This is only to find out the correct syntax for this app .........

(I start several apps with delay, but syntax will be not the same for all......... may be its a python script at startup-app - then the syntax will be different to "normal" apps)
then it might be :

Code: Select all

#!/bin/bash
(sleep 20s && python -u /usr/local/Astrill/astrill.py) &

Re: How to delay startup of an application?

Posted: Wed Jun 19, 2019 3:49 pm
by Crippled
MrEen wrote:
Wed Jun 19, 2019 3:42 pm
Just to be sure, see if this does it: Menu > Settings > Session and Startup > Application Autostart tab, click on the item then click on Edit. Change the command to sleep 20 && /usr/local/Astrill/astrill /autostart
I just tried that and it prevents Astrill from autostarting.

Re: How to delay startup of an application?

Posted: Wed Jun 19, 2019 3:53 pm
by Crippled
secureIT wrote:
Wed Jun 19, 2019 3:44 pm
if the error occurs after restart ...... next try will be :

Code: Select all

#!/bin/bash
sleep 20s && /usr/local/Astrill/astrill
This is only to find out the correct syntax for this app .........

(I start several apps with delay, but syntax will be not the same for all......... may be its a python script at startup-app - then the syntax will be different to "normal" apps)
then it might be :

Code: Select all

#!/bin/bash
(sleep 20s && python -u /usr/local/Astrill/astrill.py) &
No, the error occurs after 20 seconds of entering that command but Astrill starts. When I reboot Astrill doesn't autostart.
If I re-enable autostart and reboot Astrill starts automatically but too soon because the icon shows tiny in the panel. This is what I get on the second command. python: can't open file '/usr/local/Astrill/astrill.py': [Errno 2] No such file or directory

Re: How to delay startup of an application?

Posted: Wed Jun 19, 2019 3:55 pm
by MrEen
May ask a silly question? Are you certain the tiny icon is due Astill starting too soon?

Re: How to delay startup of an application?

Posted: Wed Jun 19, 2019 3:59 pm
by Crippled
MrEen wrote:
Wed Jun 19, 2019 3:55 pm
May ask a silly question? Are you certain the tiny icon is due Astill starting too soon?
I think so because if I exit Astrill in the panel and re-open Astrill the icon shows up properly in the panel. It's also the first to start in autostart. What say you?

Re: How to delay startup of an application?

Posted: Wed Jun 19, 2019 4:02 pm
by MrEen
Instead of restarting it, try xfce4-panel -r in the terminal to restart the panel and see if that fixes the issue.

EDIT: It's just first because it starts with "A" and the list is mostly alphabetical.