aboutsummaryrefslogtreecommitdiffstats
path: root/webmap-import
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2025-05-21 19:53:10 +0200
committerGuilhem Moulin <guilhem@fripost.org>2025-05-21 21:58:12 +0200
commitbf68b97a59e9b07fd62d3be4f7b2ba2fb3547cd4 (patch)
tree0d8ecd61c92d2f78f247a4014d69dbd313a30f3d /webmap-import
parent0e36705046a206e990cad21d9b7891ddeaf47e2d (diff)
webmap-import: Remove option --mvtdir-tmp.
Having a shared temporary directory, flock(2)'ed to avoid races, is a great idea in theory but unfortunately doesn't work so well with systemd.exec(5)'s ReadWritePaths settings since ReadWritePaths=/var/www/webmap/tiles ReadWritePaths=/var/www/webmap/tiles.tmp creates multiple mount points pointing at the same file system and rename(2)/renameat2(2) can't cope with that. Quoting the manual: EXDEV oldpath and newpath are not on the same mounted filesystem. (Linux permits a filesystem to be mounted at multiple points, but rename() does not work across different mount points, even if the same filesystem is mounted on both.) So the options are to either use a single ReadWritePaths=/var/www/webmap, or --mvtdir-tmp=/var/www/webmap/tiles/.tmp. Both kind of defeat the point (we'd in fact want to use --mvtdir-tmp=/var/tmp/webmap/tiles), so we use mkdtemp(3) instead.
Diffstat (limited to 'webmap-import')
-rwxr-xr-xwebmap-import10
1 files changed, 1 insertions, 9 deletions
diff --git a/webmap-import b/webmap-import
index 1b9cde8..1a019a4 100755
--- a/webmap-import
+++ b/webmap-import
@@ -584,9 +584,6 @@ def main() -> NoReturn:
help='optional directory for lock files to source paths')
parser.add_argument('--mvtdir', default=None,
help='optional directory for Mapbox Vector Tiles (MVT)')
- parser.add_argument('--mvtdir-tmp', default=None,
- help='temporary directory for Mapbox Vector Tiles (MVT); it must exists and be '
- 'on the same file system as the --mvtdir value')
parser.add_argument('--compress-tiles', default=False, action='store_true',
help='whether to compress Mapbox Vector Tiles (MVT) files')
parser.add_argument('--force', default=False, action='store_true',
@@ -645,11 +642,9 @@ def main() -> NoReturn:
if args.mvtdir is not None:
args.mvtdir = Path(args.mvtdir)
- if args.mvtdir == Path():
+ if args.mvtdir == Path(): # make sure it's not curdir as we don't want to exchange it
raise RuntimeError('Invalid value for --mvtdir')
args.mvtdir.parent.mkdir(parents=True, exist_ok=True)
- if args.mvtdir_tmp is not None:
- args.mvtdir_tmp = Path(args.mvtdir_tmp)
if args.cachedir is not None:
args.cachedir = Path(args.cachedir)
@@ -722,11 +717,8 @@ def main() -> NoReturn:
', '.join(args.groupname) if args.groupname is not None else '*')
else:
exportMVT(dso, layers=export_layers,
- tmpdir=args.mvtdir_tmp,
dst=args.mvtdir,
default_options=config.get('vector-tiles', None),
- mvtname=(args.groupname[0] if args.groupname is not None and
- len(args.groupname) == 1 else 'mvt'),
compress=args.compress_tiles)
if dsoTransaction: