Files
my-vault/Dehaze/mineru.service

27 lines
758 B
Desktop File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[Unit]
Description=MinerU API Server (Conda Environment)
After=network.target
[Service]
# 指定运行该服务的用户
User=wkmgc
# 指定工作目录,确保这是你代码存放的地方
WorkingDirectory=/home/wkmgc/Desktop/Mineru
# 核心:使用 mineru 环境下的 python 解释器来运行脚本
# 核心修改:不直接调 python而是先让 bash 完全激活 conda 环境,再执行脚本
ExecStart=/bin/bash -c "source /home/wkmgc/miniconda3/etc/profile.d/conda.sh && conda activate mineru && python /home/wkmgc/Desktop/Mineru/Mineru_api_server.py"
# 崩溃自动重启设置
Restart=always
RestartSec=5
# 日志输出配置
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=mineru-api
[Install]
WantedBy=multi-user.target