Skip to content

Instantly share code, notes, and snippets.

@fugaku
Last active October 6, 2018 23:26
Show Gist options
  • Select an option

  • Save fugaku/89052b2162f5a1724720f953ca09d646 to your computer and use it in GitHub Desktop.

Select an option

Save fugaku/89052b2162f5a1724720f953ca09d646 to your computer and use it in GitHub Desktop.
systemd aspnetcore service
[Unit]
Description=My ASP.NET Core
[Service]
WorkingDirectory=/var/www/myaspnetcore
ExecStart=/usr/bin/dotnet /var/www/myaspnetcore/myaspnetcore.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=dotnet-example
User=ubuntu
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment