1
This commit is contained in:
33
systemd/logistics@.service
Normal file
33
systemd/logistics@.service
Normal file
@@ -0,0 +1,33 @@
|
||||
# 物流抓取多实例模板:实例名为端口号,例如 logistics@5001.service
|
||||
# 安装:
|
||||
# sudo cp logistics@.service /etc/systemd/system/
|
||||
# sudo systemctl daemon-reload
|
||||
# sudo systemctl enable --now logistics@5001 logistics@5002 logistics@5003
|
||||
# 若原先有独立的 logistics.service 也监听 5001,请先 stop + disable,避免双开同端口。
|
||||
#
|
||||
# 对应 Java:jarvis.server.logistics.base-urls 列出上述端口。
|
||||
|
||||
[Unit]
|
||||
Description=Logistics Fetch Service (port %i)
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=van
|
||||
Group=van
|
||||
WorkingDirectory=/home/van/project/jd_python
|
||||
ExecStart=/bin/bash /home/van/project/jd_python/run_logistics.sh
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=logistics-%i
|
||||
|
||||
Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
Environment=PYTHONPATH=/home/van/project/jd_python
|
||||
Environment=HOME=/home/van
|
||||
Environment=LOGISTICS_PORT=%i
|
||||
Environment=LOG_FILE=/home/van/project/jd_python/logistics-%i.log
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user