fix: support legacy systemd path parsing

This commit is contained in:
Qiufeng
2026-08-04 10:03:18 +08:00
parent b792f3f21b
commit 4d6a9307e5
2 changed files with 17 additions and 3 deletions
+7 -3
View File
@@ -442,8 +442,8 @@ User=$ERP_USER
Group=$ERP_GROUP
Environment="ERP_INSTALL_ROOT=$INSTALL_ROOT"
Environment="ERP_CONFIG_FILE=$CONFIG_FILE"
WorkingDirectory="$INSTALL_ROOT"
ExecStart="$INSTALL_ROOT/current/bin/erp-run"
WorkingDirectory=$INSTALL_ROOT
ExecStart=$INSTALL_ROOT/current/bin/erp-run
Restart=always
RestartSec=3
TimeoutStopSec=90
@@ -453,12 +453,16 @@ NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=full
ProtectHome=true
ReadWritePaths="$INSTALL_ROOT" "$CONFIG_ROOT" "$STATE_ROOT" "$LOG_ROOT"
ReadWritePaths=$INSTALL_ROOT $CONFIG_ROOT $STATE_ROOT $LOG_ROOT
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
if command -v systemd-analyze >/dev/null 2>&1; then
systemd-analyze verify /etc/systemd/system/kaidi-erp.service \
|| fail 'generated systemd unit is invalid; run systemd-analyze verify /etc/systemd/system/kaidi-erp.service'
fi
systemctl enable kaidi-erp.service
systemctl restart kaidi-erp.service
else