生产级服务设置开机自启 在当前目录下新建asr_server.service[Unit] DescriptionSenseVoice ASR Server Service Afternetwork.target [Service] Typesimple Userwzhpc WorkingDirectory/opt/jyd01/wangruihua/gaobohui/SenseVoice EnvironmentCUDA_VISIBLE_DEVICES2 EnvironmentPATH/home/wzhpc/miniconda3/envs/sensevoice/bin:/usr/local/bin:/usr/bin:/bin ExecStart/home/wzhpc/miniconda3/envs/sensevoice/bin/python asr_server.py StandardOutputappend:/opt/jyd01/wangruihua/gaobohui/SenseVoice/logs/8009.log StandardErrorappend:/opt/jyd01/wangruihua/gaobohui/SenseVoice/logs/8009.log Restarton-failure RestartSec10 [Install] WantedBymulti-user.target1. 将服务文件复制到 systemd 目录sudo cp /opt/jyd01/wangruihua/gaobohui/SenseVoice/asr_server.service /etc/systemd/system/2. 重新加载 systemd 配置sudo systemctl daemon-reload3. 启用开机自启sudo systemctl enable asr_server.service4. 立即启动服务sudo systemctl start asr_server.service5. 查看服务状态sudo systemctl status asr_server.service6.停止服务sudo systemctl stop asr_server.service7.停止开机自启sudo systemctl disable asr_server.service