Re: Delaying Autostart

Liste des GroupesRevenir à cs raspberry-pi 
Sujet : Re: Delaying Autostart
De : tnp (at) *nospam* invalid.invalid (The Natural Philosopher)
Groupes : comp.sys.raspberry-pi
Date : 03. Jun 2025, 15:52:46
Autres entêtes
Organisation : A little, after lunch
Message-ID : <101n27u$20jc$5@dont-email.me>
References : 1 2 3 4
User-Agent : Mozilla Thunderbird
On 03/06/2025 15:17, Chris Elvidge wrote:
On 03/06/2025 at 14:00, Oscar wrote:
In article <101itmk$2mr8t$1@dont-email.me>,
Lawrence D'Oliveiro  <ldo@nz.invalid> wrote:
Instead of waiting for some fixed interval, you could add a prior command
using wget or something to repeatedly try accessing that URL, say at 5
second intervals or whatever, until it becomes accessible, before allowing
the startup to proceed.
>
For inspiration, I made a script to 'etherwake' a device and wait for it
to get ready using wget in combination with the 'timeout' command. I run
'timeout 1 wget <url>' which returns an error if wget does not respond
in 1 second, or wget returns an error itself. I use this in a while
loop that repeats this until the wget succeeds:
>
     etherwake -D -i ${IFACE} ${MACADDR}
>
     while ! timeout 1 curl --noproxy \* "${URL}" &> /dev/null
     do
         echo -n .
         sleep 1
     done
>
The OP could replace the 'sleep 120' in the other script with this loop.
>
 Why waste a curl call when ping 8.8.8.8 would work with less overhead?
 
+1. Assuming that pings to the Wide World are not blocked by the network
--
"Strange as it seems, no amount of learning can cure stupidity, and higher education positively fortifies it."
    - Stephen Vizinczey

Date Sujet#  Auteur
1 Jun 25 * Delaying Autostart13DrStevenStrange
1 Jun 25 +* Re: Delaying Autostart2Theo
1 Jun 25 i`- Re: Delaying Autostart1DrStevenStrange
2 Jun 25 `* Re: Delaying Autostart10Lawrence D'Oliveiro
3 Jun 25  `* Re: Delaying Autostart9Oscar
3 Jun 25   `* Re: Delaying Autostart8Chris Elvidge
3 Jun 25    +* Re: Delaying Autostart3Theo
3 Jun 25    i`* Re: Delaying Autostart2Oscar
3 Jun 25    i `- Re: Delaying Autostart1Oscar
3 Jun 25    +* Re: Delaying Autostart3The Natural Philosopher
3 Jun 25    i`* Re: Delaying Autostart2Oscar
4 Jun 25    i `- Re: Delaying Autostart1The Natural Philosopher
3 Jun 25    `- Re: Delaying Autostart1Oscar

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal