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