From be768ac302812426b148b48289cd4c39255ff270 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 30 Aug 2022 19:28:37 +0700 Subject: [PATCH] Set working directory in systemd service file By default systemd will execute service with root directory (or home directory for user instance) which might result in attempts to create files in unexpected place. Let's set it to 'osmocom' subdir of state directory (/var/lib for system instance) instead. Fixes: OS#5661 Change-Id: I0f942545d9e920ba8a2d8645512ec3414ab27418 --- contrib/systemd/osmo-msc.service | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/systemd/osmo-msc.service b/contrib/systemd/osmo-msc.service index 343639cf3..36849f7f6 100644 --- a/contrib/systemd/osmo-msc.service +++ b/contrib/systemd/osmo-msc.service @@ -8,6 +8,8 @@ After=osmo-hnbgw.service [Service] Type=simple Restart=always +StateDirectory=osmocom +WorkingDirectory=%S/osmocom ExecStart=/usr/bin/osmo-msc -c /etc/osmocom/osmo-msc.cfg RestartSec=2