kestrel-hellomvc.service:步骤USER产生失败/ usr/bin/dotnet:没有这样的过程

Leo*_* Du 6 deployment systemd asp.net-core

我在nginx上发布asp.net核心项目时遵循教程https://docs.microsoft.com/en-us/aspnet/core/publishing/linuxproduction

以前的步骤似乎都成功了,

但同时

systemctl start kestrel-hellomvc.service
systemctl status kestrel-hellomvc.service
Run Code Online (Sandbox Code Playgroud)

我有

kestrel-hellomvc.service - Example .NET Web API Application running on Ubuntu

Loaded: loaded (/etc/systemd/system/kestrel-hellomvc.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2017-04-24 03:12:42 UTC; 8s ago
Process: 4285 ExecStart=/usr/bin/dotnet /home/84999/Demo4/Demo4.dll (code=exited, status=217/USER)
Main PID: 4285 (code=exited, status=217/USER)

Apr 24 03:12:42 instance-5 systemd[1]: Started Example .NET Web API Application running on Ubuntu.
Apr 24 03:12:42 instance-5 systemd[4285]: kestrel-hellomvc.service: Failed at step USER spawning /usr/bin/dotnet: No such process
Apr 24 03:12:42 instance-5 systemd[1]: kestrel-hellomvc.service: Main process exited, code=exited, status=217/USER
Apr 24 03:12:42 instance-5 systemd[1]: kestrel-hellomvc.service: Unit entered failed state.
Apr 24 03:12:42 instance-5 systemd[1]: kestrel-hellomvc.service: Failed with result 'exit-code'.
Run Code Online (Sandbox Code Playgroud)

有没有人知道解决方案,似乎我没有/ usr/bin/dotnet文件夹

Sup*_*ova 8

在文件 /etc/systemd/system/gunicorn.service 中,我添加了用户。当我删除用户时,问题得到了解决。

...

[Service]
User="someuser"
...
Run Code Online (Sandbox Code Playgroud)

来源:https : //superuser.com/questions/1156676/what-c​​auses-systemd-failed-at-step-user-spawning-usr-sbin-opendkim-no-such-p


Leo*_* Du 5

我已经解决了问题,源文件夹所有者应该是www-data,有755权限

  • 很高兴听到您找到了问题的原因.您可以通过解释*您如何诊断它,以及特别是在其他地方看到哪些证据来识别这个问题,使您的答案对未来的读者更有帮助. (4认同)
  • Apache 用户在 Ubuntu 上称为“www-data”,在 CentOS 上称为“apache”。因此,如果在 Ubuntu 上运行,请在 `kestrel-hellomvc.service` 中特别设置 `User=www-data`。 (2认同)