Skip to content

Commit

Permalink
Merge pull request snaptec#2351 from yankee42/fix-backup-permissions
Browse files Browse the repository at this point in the history
fix permissions for backup dir, fix wrong positive error message from pkill
  • Loading branch information
benderl authored Aug 11, 2022
2 parents 2d0eb07 + 15833c7 commit 862a0cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 5 additions & 2 deletions runs/atreboot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ at_reboot() {
sleep 5
mkdir -p "$OPENWBBASEDIR/web/backup"
touch "$OPENWBBASEDIR/web/backup/.donotdelete"
sudo chown -R www-data:www-data "$OPENWBBASEDIR/web/backup"
sudo chown -R www-data:www-data "$OPENWBBASEDIR/web/tools/upload"
# web/backup and web/tools/upload are used to (temporarily) store backup files for download and for restoring.
# files are created from PHP as user www-data, thus www-data needs write permissions.
sudo chown -R pi:www-data "$OPENWBBASEDIR/"{web/backup,web/tools/upload}
sudo chmod -R g+w "$OPENWBBASEDIR/"{web/backup,web/tools/upload}

sudo chmod 777 "$OPENWBBASEDIR/openwb.conf"
sudo chmod 777 "$OPENWBBASEDIR/smarthome.ini"
sudo chmod 777 "$OPENWBBASEDIR/ramdisk"
Expand Down
6 changes: 2 additions & 4 deletions runs/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ chmod 777 /var/www/html/openWB/ramdisk/mqttlastregelungaktiv
# The update might replace a number of files which might currently be in use by the continuously running legacy-run
# server. If we replace the source files while the process is running, funny things might happen.
# Thus we shut-down the legacy run server before performing the update.
pkill -f "$OPENWBBASEDIR/packages/legacy_run_server.py"
pkill -u pi -f "$OPENWBBASEDIR/packages/legacy_run_server.py"

if [[ "$releasetrain" == "stable" ]]; then
train=stable17
Expand Down Expand Up @@ -72,9 +72,7 @@ git reset --hard origin/$train
# set permissions
cd /var/www/html/
sudo chown -R pi:pi openWB
sudo chown -R www-data:www-data /var/www/html/openWB/web/backup
sudo chown -R www-data:www-data /var/www/html/openWB/web/tools/upload
sudo cp /tmp/openwb.conf /var/www/html/openWB/openwb.conf
cp /tmp/openwb.conf /var/www/html/openWB/openwb.conf

# restore saved files after fetching new release
# module soc_eq
Expand Down

0 comments on commit 862a0cd

Please sign in to comment.