From 4ea77e979181f716ce9ded5468b953f8e16a8d4d Mon Sep 17 00:00:00 2001 From: van Date: Sun, 26 Apr 2026 14:08:31 +0800 Subject: [PATCH] 1 --- systemd/logistics@.service | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 systemd/logistics@.service diff --git a/systemd/logistics@.service b/systemd/logistics@.service new file mode 100644 index 0000000..c9e0b51 --- /dev/null +++ b/systemd/logistics@.service @@ -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