W
W
wio332020-12-29 23:41:29
Python
wio33, 2020-12-29 23:41:29

When disconnected from the machine, the bot stops responding, what should I do?

A simple script that, through a group in VK, throws off the weather.
I connect to the machine via ssh and run it while I'm connected to it, everything works, but as soon as I disconnect, the bot falls silent
. After reconnecting, I checked the processes using ps aux | grep python bot in place but still not responding until restart (bot)
Run with sudo python3 vk_bot_whether.py &
ps I'm a concrete newbie wherever possible

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
vreitech, 2020-12-30
@wio33

sudo nohup python3 vk_bot_whether.py &

B
BorLaze, 2020-12-30
@BorLaze

vreitech has already suggested a solution, but in general systemd services are more suitable for such things .
At a minimum, because in the case of a service:

  • the script starts automatically after the host is loaded
  • the script restarts automatically if something goes wrong and it crashes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question