Skip to content

Commit

Permalink
blockchain and shm directories must be writable
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucius committed May 24, 2024
1 parent 3f20d85 commit bbd03b0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion scripts/copy_datadir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,25 @@ set -xeuo pipefail

if [ -n "${DATA_SOURCE+x}" ]
then
echo "DATA_SOURCE: ${DATA_SOURCE}"
echo "DATADIR: ${DATADIR}"
if [ "$(realpath "${DATA_SOURCE}/datadir")" != "$(realpath "${DATADIR}")" ]
then
echo "Creating copy of ${DATA_SOURCE}/datadir inside ${DATADIR}"
sudo -Enu hived mkdir -p "${DATADIR}"
flock "${DATA_SOURCE}/datadir" sudo -En cp -pr "${DATA_SOURCE}/datadir"/* "${DATADIR}"
if [ "$(realpath "${DATA_SOURCE}/shm_dir")" != "$(realpath "${SHM_DIR}")" ]
sudo chmod -R a+w "${DATA_SOURCE}/datadir/blockchain"
ls -al "${DATA_SOURCE}/datadir/blockchain"
if [[ -e "${DATA_SOURCE}/shm_dir" && "$(realpath "${DATA_SOURCE}/shm_dir")" != "$(realpath "${SHM_DIR}")" ]]
then
echo "Creating copy of ${DATA_SOURCE}/shm_dir inside ${SHM_DIR}"
sudo -Enu hived mkdir -p "${SHM_DIR}"
flock "${DATA_SOURCE}/datadir" sudo -En cp -pr "${DATA_SOURCE}/shm_dir"/* "${SHM_DIR}"
sudo chmod -R a+w "${SHM_DIR}"
ls -al "${SHM_DIR}"
else
echo "Skipping shm_dir processing."
fi
ls -al "${DATA_SOURCE}/datadir"
fi
fi

0 comments on commit bbd03b0

Please sign in to comment.