mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-22 16:06:19 -05:00
Stopping/starting renderd during map import. Moving tile cache clearing to import script.
This commit is contained in:
parent
6376e6539b
commit
6791e88baf
8 changed files with 26 additions and 49 deletions
|
|
@ -1,13 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# Simple script which removes the Renderd map tile cache files.
|
||||
|
||||
# Re-execute this script if it wasn't called with sudo.
|
||||
if [ $EUID != 0 ]; then
|
||||
sudo "$0" "$@"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
[ -d /var/lib/mod_tile/ajt ] && rm -rf /var/lib/mod_tile/ajt
|
||||
[ -d /var/cache/renderd/tiles/ajt ] && rm -rf /var/cache/renderd/tiles/ajt
|
||||
|
||||
systemctl restart renderd
|
||||
|
|
@ -24,15 +24,24 @@ if [ ${HAS_ICE_SHEET} = false ]; then
|
|||
exit 4
|
||||
fi
|
||||
|
||||
# Re-execute this script if it wasn't called with sudo.
|
||||
if [ $EUID != 0 ]; then
|
||||
sudo "$0" "$@"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
function cleanup() {
|
||||
if [ -f ${MERGED_TMP_FILE} ]; then
|
||||
rm ${MERGED_TMP_FILE}
|
||||
fi
|
||||
systemctl restart renderd
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
cleanup
|
||||
|
||||
systemctl stop renderd
|
||||
|
||||
if [[ ${1} == *.osm.pbf ]]; then
|
||||
# Import PBF files.
|
||||
for i in "$@"; do
|
||||
|
|
@ -93,3 +102,7 @@ else
|
|||
echo "WROLPi: Cannot import unknown map file"
|
||||
exit 8
|
||||
fi
|
||||
|
||||
# Clear map tile cache only after successful import.
|
||||
[ -d /var/lib/mod_tile/ajt ] && rm -rf /var/lib/mod_tile/ajt
|
||||
[ -d /var/cache/renderd/tiles/ajt ] && rm -rf /var/cache/renderd/tiles/ajt
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ cat >/etc/sudoers.d/90-wrolpi <<'EOF'
|
|||
%wrolpi ALL= NOPASSWD:/usr/bin/systemctl restart wrolpi-app.service
|
||||
%wrolpi ALL= NOPASSWD:/usr/bin/systemctl stop wrolpi-app.service
|
||||
%wrolpi ALL= NOPASSWD:/usr/bin/systemctl start wrolpi-app.service
|
||||
%wrolpi ALL= NOPASSWD:/opt/wrolpi/scripts/clear_map_cache.sh
|
||||
%wrolpi ALL= NOPASSWD:/opt/wrolpi/scripts/import_map.sh
|
||||
EOF
|
||||
chmod 660 /etc/sudoers.d/90-wrolpi
|
||||
# Verify this new file is valid.
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ cat >/etc/sudoers.d/90-wrolpi <<'EOF'
|
|||
%wrolpi ALL= NOPASSWD:/usr/bin/systemctl restart wrolpi-app.service
|
||||
%wrolpi ALL= NOPASSWD:/usr/bin/systemctl stop wrolpi-app.service
|
||||
%wrolpi ALL= NOPASSWD:/usr/bin/systemctl start wrolpi-app.service
|
||||
%wrolpi ALL= NOPASSWD:/opt/wrolpi/scripts/clear_map_cache.sh
|
||||
%wrolpi ALL= NOPASSWD:/opt/wrolpi/scripts/import_map.sh
|
||||
EOF
|
||||
chmod 660 /etc/sudoers.d/90-wrolpi
|
||||
# Verify this new file is valid.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue