Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problema di avvio socket server su Raspbian Stretch #8

Open
lejubila opened this issue Nov 1, 2017 · 0 comments
Open

Problema di avvio socket server su Raspbian Stretch #8

lejubila opened this issue Nov 1, 2017 · 0 comments
Labels

Comments

@lejubila
Copy link
Owner

lejubila commented Nov 1, 2017

Su Raspbian Stretch il socket server, quando aperto su un indirizzo di rete diverso da localhost, non si avvia se eseguito nel crontab con la direttiva @reboot.
Questo dipende perché nel momento in cui viene tentato di avviare il socket server l'interfaccia di rete non è ancora attiva.
Per risolvere il problema prendere spunto dal seguente codice da posizionare appena prima della chiamata a tcpserver:

    count=1
    ipaddr=$(ip a s | grep -w inet | awk '{ print $2;}')
    while [[ ${ipaddr} != *${TCPSERVER_IP}* ]] && [ $count -lt 10 ];
    do
        sleep 1
        (( count++ ))
        ipaddr=$(ip a s | grep -w inet | awk '{ print $2;}')
    done`
@lejubila lejubila added the bug label Nov 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant