From f7de593ab1925ea4d1d87044d07d13a5cd97f976 Mon Sep 17 00:00:00 2001 From: Victor Phan Date: Tue, 21 Jul 2026 15:25:00 +0700 Subject: [PATCH] feat: create services directory for modularizing backend logic --- serverPython/services | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 serverPython/services diff --git a/serverPython/services b/serverPython/services new file mode 100644 index 0000000..3469f4f --- /dev/null +++ b/serverPython/services @@ -0,0 +1,26 @@ +cat << 'EOF' > /etc/systemd/system/shopeebot.service +[Unit] +Description=Shopee Affiliate Bot API +After=network.target + +[Service] +User=root +# Đường dẫn tới thư mục chứa code +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 +Restart=always +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF + +# Tải lại cấu hình systemd +systemctl daemon-reload + +# Bật tự khởi động cùng hệ điều hành +systemctl enable shopeebot + +# Khởi động service ngay bây giờ +systemctl start shopeebot