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
This commit is contained in:
Max 2022-09-09 18:38:04 +07:00
parent e5d615efdc
commit 71fc322431
1 changed files with 2 additions and 0 deletions

View File

@ -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