Skip to content

Instantly share code, notes, and snippets.

@lanekatris
Created December 29, 2017 14:37
Show Gist options
  • Save lanekatris/39078f5ca1fa9e1a83ce75ceb3576436 to your computer and use it in GitHub Desktop.
Save lanekatris/39078f5ca1fa9e1a83ce75ceb3576436 to your computer and use it in GitHub Desktop.
# sudo nano /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=www-data
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
[Install]
WantedBy=multi-user.target
# systemctl enable kestrel-hellomvc.service
# sudo journalctl -fu kestrel-hellomvc.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment