aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2022-09-09 18:38:04 +0700
committerMax <msuraev@sysmocom.de>2022-09-09 18:39:08 +0700
commit71fc3224314dad9aa5d4c204c199e75f715f0801 (patch)
tree05d9087f6127d0caf0299621dd52aacdd84ce004
parente5d615efdcffa9b248c555d1db5ce596649ef28d (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. Related: OS#4821 Change-Id: If21e3471ec129892ff8b410db30d8ce0e4014e05
-rw-r--r--contrib/systemd/osmo-stp.service2
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/systemd/osmo-stp.service b/contrib/systemd/osmo-stp.service
index 87b414b..79394fa 100644
--- a/contrib/systemd/osmo-stp.service
+++ b/contrib/systemd/osmo-stp.service
@@ -5,6 +5,8 @@ Documentation=https://osmocom.org/projects/osmo-stp/wiki
[Service]
Type=simple
Restart=always
+StateDirectory=osmocom
+WorkingDirectory=%S/osmocom
ExecStart=/usr/bin/osmo-stp -c /etc/osmocom/osmo-stp.cfg
RestartSec=2