我在nginx
上发布asp.net核心项目时正在关注教程https://docs.microsoft.com/en-us/aspnet/core/publishing/linuxproduction之前的步骤似乎都成功了,
但是
systemctl start kestrel-hellomvc.service
systemctl status kestrel-hellomvc.service
我得到了
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'.
有人知道解决方案,似乎我没有/ usr / bin / dotnet文件夹
答案 0 :(得分:5)
我已经解决了问题,源文件夹所有者应该是www-data,有755权限
答案 1 :(得分:1)
如果您的服务文件中定义的用户不存在,则无论Web应用程序文件夹上的权限如何,都会显示相同的错误消息。
答案 2 :(得分:1)
经过几个小时,我的答案是" yum重新安装systemd"
答案 3 :(得分:0)
在文件/etc/systemd/system/gunicorn.service中,我添加了用户。当我删除用户时,该问题已解决。
...
[Service]
User="someuser"
...