chore: add systemd service configuration for shopeebot automation
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
systemctl unmask shopeebot
|
||||||
|
|
||||||
cat << 'EOF' > /etc/systemd/system/shopeebot.service
|
cat << 'EOF' > /etc/systemd/system/shopeebot.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Shopee Affiliate Bot API
|
Description=Shopee Affiliate Bot API
|
||||||
@@ -5,9 +7,7 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=root
|
User=root
|
||||||
# Đường dẫn tới thư mục chứa code
|
|
||||||
WorkingDirectory=/root/botAffilate/serverPython
|
WorkingDirectory=/root/botAffilate/serverPython
|
||||||
# Lệnh chạy API sử dụng môi trường ảo venv
|
|
||||||
ExecStart=/root/botAffilate/serverPython/venv/bin/python main.py
|
ExecStart=/root/botAffilate/serverPython/venv/bin/python main.py
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
@@ -16,11 +16,6 @@ RestartSec=5
|
|||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Tải lại cấu hình systemd
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
||||||
# Bật tự khởi động cùng hệ điều hành
|
|
||||||
systemctl enable shopeebot
|
systemctl enable shopeebot
|
||||||
|
|
||||||
# Khởi động service ngay bây giờ
|
|
||||||
systemctl start shopeebot
|
systemctl start shopeebot
|
||||||
|
|||||||
Reference in New Issue
Block a user