systemctl Ubuntu запуск dotnet как службы

C Sharp > systemctl Ubuntu запуск dotnet как службы
17.02.2019 23:36:05


Наиболее часто встречающиеся слова в статье:

[service] [kestrel] [systemctl] [опубликуем] [www/www/] [publish] [--configuration] [Release] [Создадим] [/etc/systemd/system/]


Статья:

 
#опубликуем
cd www/www/
dotnet publish --configuration Release 
 
 
Создадим файл  kestrel.service   в /etc/systemd/system/
[Unit]
Description=Example .NET Web API App running on Ubuntu
 
[Service]
WorkingDirectory=/home/iocsha/dot_net/publish
ExecStart=/usr/bin/dotnet /home/iocsha/dot_net/publish/www.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=dotnet-example
User=iocsha
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
 
[Install]
WantedBy=multi-user.target
 
Затем : #systemctl enable kestrel.service
#systemctl start kestrel.service
#systemctl status kestrel.service