Answer the question
In order to leave comments, you need to log in
How to organize the launch of scripts on the server?
There is a VDS server with ubuntu. I want to organize several telegram bots on it, as well as raise the rest service. Advise articles, otherwise the variety of ways is darkness.
Of course, I would like a single system, like this can be done on Flask, but I have never worked with it.
Answer the question
In order to leave comments, you need to log in
1. Virtual environment for the bot
virtualenv --python=/usr/bin/python3.5 /srv/venv/telegram-bot-1
source /srv/venv/telegram-bot-1/bin/activate
pip install -r requirements. txt
2. Systemd service for bot
/etc/systemd/system/telegram-bot-1.service
----------------------- --------------------
[Unit]
Description=Telegram bot
After=syslog.target
After=network.target
[Service]
Type=simple
User=root
ExecStart=/srv /venv/telegram-bot-1/bin/python3.5 /usr/local/bin/telegram-bot-1/bot.py
RestartSec=10
Restart=always
[Install]
WantedBy=multi-user.target
-------------------------------------------------
systemctl daemon-reload
systemctl start telegram-bot-1.service
systemctl enable telegram-bot-1.service
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question