2017-06-03 78 views
0

我收到以下錯誤:Linux的1604:紅隼服務找不到DOTNET安裝

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. 

在運行時: https://docs.microsoft.com/en-us/aspnet/core/publishing/linuxproduction

運行:

systemctl start kestrel-hellomvc.service 

本指南如下: nano /usr/bin/dotnet給我一個包含內容的大文件,which dotnet返回 /usr/bin/dotnet,所以文件確實存在(?)

爲什麼我得到這個錯誤,以及解決方案是什麼?

編輯: 我/etc/systemd/system/kestrel-hellomvc.service文件:

[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 
+0

嘗試以root身份運行'ExecStart'命令。您可能會遇到不同的問題。 –

回答

0

DOTNET可能不會位於USR/bin中。在Ubuntu Server 16.04上,mine位於/ usr/share/dotnet,服務文件中的可執行文件是/ usr/share/dotnet/dotnet。