From 681420f6f63e0dadce93977c1c50b6d64404e61c Mon Sep 17 00:00:00 2001 From: Ben Ramey Date: Sat, 25 Feb 2023 13:24:04 +0000 Subject: [PATCH] Service config file for running twain on kestrel --- tools/deployment/kestrel-twain.service | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tools/deployment/kestrel-twain.service diff --git a/tools/deployment/kestrel-twain.service b/tools/deployment/kestrel-twain.service new file mode 100644 index 0000000..43acb41 --- /dev/null +++ b/tools/deployment/kestrel-twain.service @@ -0,0 +1,22 @@ +[Unit] +Description=Twain .NET App on Kestrel + +[Service] +WorkingDirectory=/var/www/twain +ExecStart=/usr/bin/dotnet /var/www/twain/twain.dll +Restart=always +# Restart service after 10 seconds if the dotnet service crashes: +RestartSec=10 +KillSignal=SIGINT +SyslogIdentifier=twain +User=www-data +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 \ No newline at end of file