aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2022-08-30 19:28:37 +0700
committerMax <msuraev@sysmocom.de>2022-08-30 19:37:20 +0700
commitbe768ac302812426b148b48289cd4c39255ff270 (patch)
treeef76555c04113896dfada6e6caf3149988d139b8
parent088043fae43f959ccd24105a2d0fd7ce2a5a58c2 (diff)
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
-rw-r--r--contrib/systemd/osmo-msc.service2
1 files changed, 2 insertions, 0 deletions
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