nex_buddy/scripts/nex-buddy.service

27 lines
661 B
INI
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# systemd 模板:首次部署时改好路径和运行用户,再复制到 /etc/systemd/system/。
#
# sudo cp scripts/nex-buddy.service /etc/systemd/system/nex-buddy.service
# sudo systemctl daemon-reload
# sudo systemctl enable --now nex-buddy
#
# 服务只需要读 .env,不把密钥再抄一份到 systemd 里。
[Unit]
Description=nex_buddy API
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=www-data
Group=www-data
WorkingDirectory=/opt/nex_buddy
ExecStart=/bin/bash /opt/nex_buddy/scripts/start.sh
Restart=always
RestartSec=3
Environment=PYTHONUNBUFFERED=1
UMask=0077
[Install]
WantedBy=multi-user.target