Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove hardcoded rootPath values #1874

Merged
merged 4 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions scripts/service/athens.service
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 3 additions & 6 deletions scripts/systemd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines -48 to -49
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the chown and chgrp commands be kept in order to still make sure www-data owns the ReadWritePaths?

}

# doInstallBinary copies the Athens binary to /usr/local/bin with the necessary settings.
Expand All @@ -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
Expand Down