Re: Delaying Autostart

Liste des GroupesRevenir à cs raspberry-pi 
Sujet : Re: Delaying Autostart
De : jornws200602 (at) *nospam* xs4all.nl (Oscar)
Groupes : comp.sys.raspberry-pi
Date : 03. Jun 2025, 20:56:40
Autres entêtes
Organisation : A butterfly in Tokio
Message-ID : <101nk1o$7uua$1@dont-email.me>
References : 1 2 3 4
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <101niml$7k6m$2@dont-email.me>,
Oscar <jornws200602@xs4all.nl> wrote:
Yeah. And curl is not *that* expensive to run. Maybe even less expensive
than ping, as it does not have the setuid overhead. But who's counting
clock cycles anyway?

Following up on myself: Okay, ping loads a bit quicker as it's
executable is smaller and it loads less libraries, but it still
is a setuid binary.

I must admit I still don't understand why you thing the overhead of
calling curl is a waste. Both are external programs and we're in a wait
loop anyway. Why hurry in between to sleep calls?

In this case curl beats ping, as OP's question was related to a slow
staring Grafana server. Ping can't tell if Grafana is running. With curl
you can see if a string is in the output.

Say for examplje you're waiting for a specific dasboard to load, with
the title "Hootenmany". You could run this slightly modified version:


    while ! timeout 1 curl -s ${URL} | grep -qs Hootenanny
    do
        echo -n .
        sleep 1
    done

This will loop until curl returns something with the string 'Hootenanny'
within 1 second and fail if there's no network, no dns, no route to the
Grafana server or while Grafana server is still starting up.

And *that's* what the OP asked.
--
[J|O|R] <- .signature.gz

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