From 9355e2d24bc6766b7763ea519910af749b2afb6f Mon Sep 17 00:00:00 2001 From: Kim Huebel Date: Thu, 28 Jan 2021 21:49:09 +0000 Subject: [PATCH] Modified system-scripts to not run as root but as system-user mmdvm. Also added command in installation steps to create this user --- README.md | 1 + systemd/http.server.service | 4 +++- systemd/logtailer.service | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 11e8713..a519cfd 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ Actually known: * Python3.7 at least must be instaled ### Installation steps +* first of all (if not already done by installation of MMDVMHost): create a syetemuser with `sudo adduser --system --no-create-home --group mmdvm` * clone this repository to your home-directory with `git clone --recurse-submodules -j8 https://github.com/dg9vh/MMDVMHost-Websocketboard` to clone the repository with it's submodules * create directory with `sudo mkdir /opt/MMDVMDash` * change ownership to your user for example with `sudo chown -R pi /opt/MMDVMDash` diff --git a/systemd/http.server.service b/systemd/http.server.service index 7342800..cfdf9c3 100644 --- a/systemd/http.server.service +++ b/systemd/http.server.service @@ -3,9 +3,11 @@ Description=Python3 http.server After=network.target [Service] -ExecStartPre=/bin/sleep 30 Type=simple +User=mmdvm +Group=mmdvm Restart=always +ExecStartPre=/bin/sleep 30 # Modify for different location of Python3 or other port ExecStart=/usr/bin/python3 -m http.server 8000 --directory /opt/MMDVMDash/html diff --git a/systemd/logtailer.service b/systemd/logtailer.service index 7e65f4c..49fcb26 100644 --- a/systemd/logtailer.service +++ b/systemd/logtailer.service @@ -3,9 +3,11 @@ Description=Python3 logtailer for MMDVMDash After=network.target [Service] -ExecStartPre=/bin/sleep 30 Type=simple +User=mmdvm +Group=mmdvm Restart=always +ExecStartPre=/bin/sleep 30 # Modify for different location of Python3 or other port WorkingDirectory=/opt/MMDVMDash/ ExecStart=/usr/bin/python3 /opt/MMDVMDash/logtailer.py