首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Linux 1604: kestrel服务找不到dotnet安装

Linux 1604: kestrel服务找不到dotnet安装
EN

Stack Overflow用户
提问于 2017-06-03 06:54:36
回答 2查看 3.2K关注 0票数 0

我得到了以下错误:

代码语言:javascript
运行
复制
Jun 03 06:41:04 {my_digital_ocean_server} systemd[13752]: kestrel-hellomvc.service: Failed at step CHDIR spawning /usr/bin/dotnet: No such file or directory
-- Subject: Process /usr/bin/dotnet could not be executed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The process /usr/bin/dotnet could not be executed and failed.

跑步时:

代码语言:javascript
运行
复制
systemctl start kestrel-hellomvc.service

遵循本指南:https://learn.microsoft.com/en-us/aspnet/core/publishing/linuxproduction

运行:nano /usr/bin/dotnet为我提供一个包含内容的大文件,which dotnet返回/usr/bin/dotnet,所以文件存在(?)。

为什么我会有这个错误,解决方案是什么?

编辑: My /etc/systemd/system/kestrel-hellomvc.service文件:

代码语言:javascript
运行
复制
[Unit]
Description=Example .NET Web API Application running on Ubuntu

[Service]
WorkingDirectory=/var/aspnetcore/hellomvc
ExecStart=/usr/bin/dotnet /var/aspnetcore/hellomvc/hellomvc.dll
Restart=always
RestartSec=10  # Restart service after 10 seconds if dotnet service crashes
SyslogIdentifier=dotnet-example
User=root
Environment=ASPNETCORE_ENVIRONMENT=Production 

[Install]
WantedBy=multi-user.target
EN

回答 2

Stack Overflow用户

发布于 2018-02-14 22:34:18

Dotnet可能不在usr/bin中。在UbuntuServer16.04上,我位于/usr/share/dotnet,服务文件中的可执行行是/usr/share/dotnet/dotnet。

票数 1
EN

Stack Overflow用户

发布于 2019-03-29 03:18:52

代码语言:javascript
运行
复制
which dotnet

查找应用程序服务文件/etc/systemd/system/kestrel-MyAppName.service属性的正确路径

代码语言:javascript
运行
复制
ExecStart=/bin/dotnet /var/www/dev-slc1.almw.local/public_html/MyAppName.dll

例如,在CentOS7上,which dotnet的结果出现在上面:/bin/dotnet

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44341240

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档