Skip to content

Commit f969e03

Browse files
Jeansenmanugupt1matt0x6F
authored
Remove hard coded values from SystemD Unit and installation (#1874)
Removes hardcoded values form our supplied SystemD Unit file and the installation script. Users, prior to installation, will need to ensure that their user, group, and permissions settings of where Athens stores data are correct. Co-authored-by: Manu Gupta <[email protected]> Co-authored-by: Matt <[email protected]>
1 parent 8141583 commit f969e03

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

scripts/service/athens.service

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ Nice=5
1414
User=www-data
1515
Group=www-data
1616

17-
Environment=ATHENS_DISK_STORAGE_ROOT=/var/run/athens
18-
1917
; The full path and the arguments of the command to be executed to start the process.
2018
ExecStart=/usr/local/bin/athens -config_file=/etc/athens/config.toml
2119

scripts/systemd.sh

+3-6
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@ function doInstallConfig
4141
fi
4242
sudo mkdir -p /etc/athens
4343
sudo install -v -o root -g root -m 644 config.toml /etc/athens
44-
45-
# if storage is on disk, this is where the database goes (see scripts/service/athens.service)
46-
ATHENS_DISK_STORAGE_ROOT=/var/run/athens
47-
sudo mkdir -p $ATHENS_DISK_STORAGE_ROOT
48-
sudo chown www-data $ATHENS_DISK_STORAGE_ROOT
49-
sudo chgrp www-data $ATHENS_DISK_STORAGE_ROOT
5044
}
5145

5246
# doInstallBinary copies the Athens binary to /usr/local/bin with the necessary settings.
@@ -69,6 +63,9 @@ function doInstallBinary
6963
# doInstallSystemd sets up the SystemD service unit.
7064
function doInstallSystemd
7165
{
66+
local rootPath=$(sed -nr 's/(RootPath) = (".*")/\2/p' /etc/athens/config.toml | xargs)
67+
sed -i "/ReadWritePaths/ s|=.*|=$rootPath|" scripts/service/athens.service
68+
7269
sudo install -v -o root -g root -m 644 scripts/service/athens.service /etc/systemd/system
7370
sudo systemctl daemon-reload
7471
sudo systemctl enable athens

0 commit comments

Comments
 (0)