From a2e2bb1378cda01f777cf0dcc250ddbb1ee8ee01 Mon Sep 17 00:00:00 2001 From: OptimusGREEN Date: Fri, 12 Aug 2022 15:24:08 +0100 Subject: [PATCH] Linux Service Instructions --- README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/README.md b/README.md index 0c55f6a..d0ef7f9 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,54 @@ Instead of running in Docker you can install it as a service in Windows or Linux 1. In `appsettings.json` replace the `Database` `Path` to a path on your host. 1. When using Windows paths, make sure to escape the slashes. For example: `D:\\RdtClient\\db\\rdtclient.db` +## Linux Service + +Instead of running in Docker you can install it as a service in Linux. + +1. Install .NET: [https://docs.microsoft.com/en-us/dotnet/core/install/linux](https://docs.microsoft.com/en-us/dotnet/core/install/linux) + + Ubuntu 20.04 example: + ```wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb``` + + ```sudo dpkg -i packages-microsoft-prod.deb``` + + ```rm packages-microsoft-prod.deb``` + + ```sudo apt-get update && sudo apt-get install -y dotnet-sdk-6.0``` + +2. Get latest archive from [releases](https://github.com/rogerfar/rdt-client/releases): +```wget ``` +3. Extract to path of your choice (~/rtdc in this example): +```unzip RealDebridClient.zip -d ~/rdtc && cd ~/rdtc``` +4. In appsettings.json replace the Database Path to a path on your host. Any directories in path must already exist. Or just remove "/data/db/" for ease. +5. Test rdt client runs ok: +```dotnet RdtClient.Web.dll``` +navigate to http://:6500, if all is good then we'll create a service +6. Create a service (systemd in this example): +```sudo nano /etc/systemd/system/rdtc.service``` + + paste in this service file content and edit path of your directory: + + ``` + [Unit] + Description=RdtClient Service + + [Service] + + WorkingDirectory=/home//rdtc + ExecStart=/usr/bin/dotnet RdtClient.Web.dll + SyslogIdentifier=RdtClient + User= + + [Install] + WantedBy=multi-user.target + ``` + +7. enable and start the service: +```sudo systemctl daemon-reload``` +```sudo systemctl enable rdtc``` +```sudo systemctl start rdtc``` + ## Setup ### First Login