From 54859ac3baede8293acdac1737dfe80fca5092ad Mon Sep 17 00:00:00 2001 From: manuelkamp <48356947+manuelkamp@users.noreply.github.com> Date: Wed, 27 Dec 2023 19:52:51 +0100 Subject: [PATCH] Update LocalRunGuide.md Improved optional service section regarding environment variables in a separate .env file --- LocalRunGuide.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/LocalRunGuide.md b/LocalRunGuide.md index 7126969f..c7eaca0b 100644 --- a/LocalRunGuide.md +++ b/LocalRunGuide.md @@ -204,6 +204,12 @@ Note: Currently the app will run in the background until manually closed. ### Optional: Run Stirling-PDF as a service +First create a .env file, where you can store environment variables: +``` +touch /opt/Stirling-PDF/.env +``` +In this file you can add all variables, one variable per line, as stated in the main readme (for example SYSTEM_DEFAULTLOCALE="de-DE"). + Create a new file where we store our service settings and open it with nano editor: ``` nano /etc/systemd/system/stirlingpdf.service @@ -223,6 +229,7 @@ Group=root Type=simple +EnvironmentFile=/opt/Stirling-PDF/.env WorkingDirectory=/opt/Stirling-PDF ExecStart=/usr/bin/java -jar Stirling-PDF-0.17.2.jar ExecStop=/bin/kill -15 $MAINPID