From 14f2bd2db4beaec82676f501f62137863358473c Mon Sep 17 00:00:00 2001 From: Dirk Kuypers Date: Thu, 16 Dec 2021 15:17:21 +0100 Subject: [PATCH] Add a documemtation section about how to add a systemd service --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 1e9072e..05913ca 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,33 @@ Per default a symlink will by created in /usr/local/bin pointing to your applica my-app ``` +## Creating a Systemd Service + +Add a `my-app.service` file to your project containing at least the following + +``` +[Unit] +Description=My awesome app + +[Service] +Type=simple +ExecStart=/usr/local/bin/my-app + +[Install] +WantedBy=multi-user.target +``` + +Add the `my-app.service` file to an `` of your `.csproj` with the following content to make sure that it is installed at the right place. + +``` + + /etc/systemd/system/my-app.service + +``` + +Make sure to set the Property `true` in your `.csproj` file. + + ### Note You can invoke the packaging tools manually, using a MSBuild target instead of using the a .NET Core CLI tool: