Python not getting IP if cable connected after script has started

后端 未结 3 1625
醉酒成梦
醉酒成梦 2021-01-16 14:51

I hope this doesn\'t cross into superuser territory.

So I have an embedded linux, where system processes are naturally quite stripped. I\'m not quite sure which syst

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-16 15:34

    After alot more research, the glibc problem jedwards suggested, seemed to be the problem. I did not find a solution, but made workaround for my usecase. Considering I only use one URL, I added my own "resolv.file" . A small daemon gets the IP address of the URL when PHY reports cable connected. This IP is saved to "my own resolv.conf". From this file the python script retrieves the IP to use for posts.

    Not really a good solution, but a solution.

提交回复
热议问题