diff --git a/scripts/service/athens.service b/scripts/service/athens.service index 06de46a39..7d39bb264 100644 --- a/scripts/service/athens.service +++ b/scripts/service/athens.service @@ -14,8 +14,6 @@ Nice=5 User=www-data Group=www-data -Environment=ATHENS_DISK_STORAGE_ROOT=/var/run/athens - ; The full path and the arguments of the command to be executed to start the process. ExecStart=/usr/local/bin/athens -config_file=/etc/athens/config.toml diff --git a/scripts/systemd.sh b/scripts/systemd.sh index 7bb4c2dd4..a877825e5 100755 --- a/scripts/systemd.sh +++ b/scripts/systemd.sh @@ -41,12 +41,6 @@ function doInstallConfig fi sudo mkdir -p /etc/athens sudo install -v -o root -g root -m 644 config.toml /etc/athens - - # if storage is on disk, this is where the database goes (see scripts/service/athens.service) - ATHENS_DISK_STORAGE_ROOT=/var/run/athens - sudo mkdir -p $ATHENS_DISK_STORAGE_ROOT - sudo chown www-data $ATHENS_DISK_STORAGE_ROOT - sudo chgrp www-data $ATHENS_DISK_STORAGE_ROOT } # doInstallBinary copies the Athens binary to /usr/local/bin with the necessary settings. @@ -69,6 +63,9 @@ function doInstallBinary # doInstallSystemd sets up the SystemD service unit. function doInstallSystemd { + local rootPath=$(sed -nr 's/(RootPath) = (".*")/\2/p' /etc/athens/config.toml | xargs) + sed -i "/ReadWritePaths/ s|=.*|=$rootPath|" scripts/service/athens.service + sudo install -v -o root -g root -m 644 scripts/service/athens.service /etc/systemd/system sudo systemctl daemon-reload sudo systemctl enable athens