From bf3df41f4bf914ae8a800f598dd4a9479e674f13 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Tue, 11 Jul 2023 10:24:19 +0200 Subject: new systemd-service with some protections --- energyscripts-SCRIPT@ADDRESS.service | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 energyscripts-SCRIPT@ADDRESS.service (limited to 'energyscripts-SCRIPT@ADDRESS.service') diff --git a/energyscripts-SCRIPT@ADDRESS.service b/energyscripts-SCRIPT@ADDRESS.service new file mode 100644 index 0000000..ab26429 --- /dev/null +++ b/energyscripts-SCRIPT@ADDRESS.service @@ -0,0 +1,26 @@ +[Unit] +Description = Simple service to start mqtt-listener +StartLimitIntervalSec = 100 +StartLimitBurst = 5 + +[Service] +User = energy +Group = energy + +Type = simple +EnvironmentFile = /opt/energyscripts/.env +WorkingDirectory = /opt/energyscripts +ExecStart = /opt/energyscripts/venv/bin/python3 -u scripts/%j.py -a %i +Restart = on-failure +TimeoutStopSec = 70 +RestartSec = 30 +SyslogIdentifier = %N + +NoNewPrivileges = true +ProtectHome = tmpfs +ProtectSystem = full +PrivateDevices = true +ReadWritePaths = /opt/energyscripts/queue + +[Install] +WantedBy = default.target -- cgit v1.2.3