What about running echobot python script as a service ? #2498
Replies: 3 comments 5 replies
-
use |
Beta Was this translation helpful? Give feedback.
-
I found a solution, a quick and dirty one ... Simply I run the command using nohup
Not the best solution but I have got time to investivate further ... |
Beta Was this translation helpful? Give feedback.
-
Here is what works for a Bot I run in a production environment. This works without any flaws on the live server. I am using pipenv so I have the full path to the Python interpreter in ExecStart and WorkingDirectory pointed to the directory that has the main entry point to the Telegram bot.
|
Beta Was this translation helpful? Give feedback.
-
Is it possibile to run the echobot.py, included in examples of python-telegram-bot, as a linux service on an ubuntu instance ?
I tried to do it but without success.
I followed indication found here but when i start the service it fails to run.
This is the result of sudo systemctl status tlgrm-echobot.service
Here is the content of /usr/bin/tlgrm_echobot.service
[Unit]
Description=Telegram echo bot service
After=multi-user.target
Conflicts=getty@tty1.service
[Service]
Type=simple
ExecStart=/usr/bin/python /home/ubuntu/python/python-telegram-bot/echobot.py
StandardInput=tty-force
[Install]
WantedBy=multi-user.target
Anyway, may target is to find the best way to run always a python script that manages my new telegram bot I created, not so far from echobot.py script.
Thanks in advance fon any kind of help, Vincenzo Frezza.
Beta Was this translation helpful? Give feedback.
All reactions