I let my python script run at startup but some of HTTP requests (using
requests pip module) not working. However, when I run the script manually with
sudo openvt -s -w /path/to/launcher.sh, all HTTP requests are working fine.
this is my code in
sudo openvt -s -w /path/to/launcher.sh
launcher.sh, it is as simple as
cd to directory and run python script.
cd /path/to/python/script python start.py
when the script is run at startup. HTTP requests throw this error:
ConnectionError: HTTPSConnectionPool(host='', port=443): Max retries exceeded with url: /my/api (Caused by <class 'socket.gaierror'>: [Errno -3] Temporary failure in name resolution)
Again, when I run the script via
ssh using this command
sudo openvt -s -w /path/to/launcher.sh, everything is working fine. I'm struggling this bugs for days. Thank you so much for any helps :)