From 0f78411efe31b187a1c2844f39caeb29a821d610 Mon Sep 17 00:00:00 2001 From: billz Date: Fri, 2 Aug 2024 20:25:37 +0200 Subject: [PATCH 1/2] Set root owner on installers/restapi.service --- installers/common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/installers/common.sh b/installers/common.sh index 4ee313f9c..4a79fbc14 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -546,6 +546,7 @@ function _install_restapi() { python3 -m pip install -r "$raspap_dir/api/requirements.txt" --break-system-packages || _install_status 1 " Unable to install pip modules" echo "Moving restapi systemd unit control file to /lib/systemd/system/" + sudo chown -c root:root $webroot_dir/installers/restapi.service || _install_status 1 "Unable change owner and/or group" sudo mv $webroot_dir/installers/restapi.service /lib/systemd/system/ || _install_status 1 "Unable to move restapi.service file" sudo systemctl daemon-reload sudo systemctl enable restapi.service || _install_status 1 "Failed to enable restapi.service" From 4afd67f0b0ed0e278ee2fc6cb30ee6dbe2f979ce Mon Sep 17 00:00:00 2001 From: billz Date: Sat, 3 Aug 2024 08:10:45 +0200 Subject: [PATCH 2/2] Add status message --- installers/common.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index 4a79fbc14..acd8982bb 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -544,9 +544,10 @@ function _install_restapi() { fi python3 -m pip install -r "$raspap_dir/api/requirements.txt" --break-system-packages || _install_status 1 " Unable to install pip modules" - - echo "Moving restapi systemd unit control file to /lib/systemd/system/" + + echo "Setting permissions on restapi systemd unit control file" sudo chown -c root:root $webroot_dir/installers/restapi.service || _install_status 1 "Unable change owner and/or group" + echo "Moving restapi systemd unit control file to /lib/systemd/system/" sudo mv $webroot_dir/installers/restapi.service /lib/systemd/system/ || _install_status 1 "Unable to move restapi.service file" sudo systemctl daemon-reload sudo systemctl enable restapi.service || _install_status 1 "Failed to enable restapi.service"