#linux #asp.net-core
#линукс #asp.сетевое ядро
Вопрос:
Я сталкиваюсь с «Сбой на этапе создания CHDIR /usr/bin/dotnet: такого файла или каталога нет» в моем проекте NETCore 3.1 ASP MVC, что я пропустил?
=== /var/журнал/сообщение
Dec 5 11:49:30 iZk1aa2qin3uxnqh8agvrmZ systemd: Stopping .NET Web Application on Linux... Dec 5 11:49:30 iZk1aa2qin3uxnqh8agvrmZ dotnet-example: Application is shutting down... Dec 5 11:49:30 iZk1aa2qin3uxnqh8agvrmZ systemd: Stopped .NET Web Application on Linux. Dec 5 11:49:30 iZk1aa2qin3uxnqh8agvrmZ systemd: Started .NET Web Application on Linux. Dec 5 11:49:31 iZk1aa2qin3uxnqh8agvrmZ dotnet-example: Hosting environment: Production Dec 5 11:49:31 iZk1aa2qin3uxnqh8agvrmZ dotnet-example: Content root path: /var/www/html/b2b/api Dec 5 11:49:31 iZk1aa2qin3uxnqh8agvrmZ dotnet-example: Now listening on: http://127.0.0.1:5000 Dec 5 11:49:31 iZk1aa2qin3uxnqh8agvrmZ dotnet-example: Application started. Press Ctrl C to shut down. Dec 5 11:49:32 iZk1aa2qin3uxnqh8agvrmZ systemd: kestrel-primetelco3.service holdoff time over, scheduling restart. Dec 5 11:49:32 iZk1aa2qin3uxnqh8agvrmZ systemd: Stopped .NET Web Application on Linux. Dec 5 11:49:32 iZk1aa2qin3uxnqh8agvrmZ systemd: Started .NET Web Application on Linux. Dec 5 11:49:32 iZk1aa2qin3uxnqh8agvrmZ systemd: Failed at step CHDIR spawning /usr/bin/dotnet: No such file or directory Dec 5 11:49:32 iZk1aa2qin3uxnqh8agvrmZ systemd: kestrel-primetelco3.service: main process exited, code=exited, status=200/CHDIR Dec 5 11:49:32 iZk1aa2qin3uxnqh8agvrmZ systemd: Unit kestrel-primetelco3.service entered failed state. Dec 5 11:49:32 iZk1aa2qin3uxnqh8agvrmZ systemd: kestrel-primetelco3.service failed.
=== дотнет уже есть
[root@iZk1aa2qin3uxnqh8agvrmZ html]# ls -la /usr/bin/dotnet lrwxrwxrwx 1 корневой корень 24 августа 3 11:42 /usr/bin/dotnet -gt; /usr/поделиться/dotnet/dotnet
=== моя пустельга
[Unit] Description=.NET Web Application on Linux [Service] WorkingDirectory=/var/www/html/b2b/api ExecStart=/usr/bin/dotnet /var/www/html/b2b/api/B2B.dll Restart=always # Restart service after 10 seconds if the dotnet service crashes: RestartSec=10 KillSignal=SIGINT SyslogIdentifier=dotnet-example User=root Environment=ASPNETCORE_ENVIRONMENT=Production Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false # How many seconds to wait for the app to shut down after it receives the initial interrupt signal. # If the app doesn't shut down in this period, SIGKILL is issued to terminate the app. # The default timeout for most distributions is 90 seconds. TimeoutStopSec=90 [Install] WantedBy=multi-user.target
но если я проверю статус, он уже запущен
[root@iZk1aa2qin3uxnqh8agvrmZ ~]# systemctl status kestrel-b2b.service ● kestrel-b2b.service - .NET Web Application on Linux Loaded: loaded (/etc/systemd/system/kestrel-b2b.service; disabled; vendor preset: disabled) Active: active (running) since Sun 2021-12-05 11:13:21 WIB; 1min 37s ago Main PID: 2848 (dotnet) CGroup: /system.slice/kestrel-b2b.service └─2848 /usr/bin/dotnet /var/www/html/b2b/api/B2B.dll Dec 05 11:13:21 iZk1aa2qin3uxnqh8agvrmZ systemd[1]: Stopped .NET Web Application on Linux. Dec 05 11:13:21 iZk1aa2qin3uxnqh8agvrmZ systemd[1]: Started .NET Web Application on Linux. Dec 05 11:13:22 iZk1aa2qin3uxnqh8agvrmZ dotnet-example[2848]: Hosting environment: Production Dec 05 11:13:22 iZk1aa2qin3uxnqh8agvrmZ dotnet-example[2848]: Content root path: /var/www/html/b2b/api Dec 05 11:13:22 iZk1aa2qin3uxnqh8agvrmZ dotnet-example[2848]: Now listening on: http://127.0.0.1:5000 Dec 05 11:13:22 iZk1aa2qin3uxnqh8agvrmZ dotnet-example[2848]: Application started. Press Ctrl C to shut down.