如何修复 systemd 错误:Failed to determine user credentials: No such process
问题
你有一个 systemd 服务,例如
service_unit.ini
[Unit]
Description=My Service
[Service]
ExecStart=/usr/bin/my-service
User=myuser
[Install]
WantedBy=multi-user.target但在日志中(systemctl status my-service)你看到以下错误:
journalctl-log.txt
Jun 19 18:41:36 mycomputer (nice)[1349797]: my-service.service: Failed to determine user credentials: No such process
Jun 19 18:41:36 mycomputer systemd[1]: my-service.service: Main process exited, code=exited, status=217/USER解决方案
原因很简单:你在 User= 指令中指定的用户在你的系统上不存在。
检查用户名是否有拼写错误,并验证它在运行服务的计算机上确实存在。
按类别查看类似文章:
Systemd
如果这篇文章对您有帮助,请考虑请我喝杯咖啡或通过 PayPal 捐款,以支持 TechOverflow 上新文章的研究与发布