diff --git a/archivebox/machine/models.py b/archivebox/machine/models.py index c2182342..2ad94389 100755 --- a/archivebox/machine/models.py +++ b/archivebox/machine/models.py @@ -1579,7 +1579,12 @@ class Process(ModelWithDeleteAfter, models.Model): """ cleaned = 0 - stale = cls.objects.filter(status=cls.StatusChoices.RUNNING) + # Top-level commands own their lifecycle and may run in another Docker + # PID namespace while sharing this database. Their takeover helpers + # validate and finalize them; local psutil cannot do so safely. + stale = cls.objects.filter(status=cls.StatusChoices.RUNNING).exclude( + process_type__in=(cls.TypeChoices.SERVER, cls.TypeChoices.ADD, cls.TypeChoices.UPDATE), + ) if machine is not None: stale = stale.filter(machine=machine) diff --git a/docker-compose.yml b/docker-compose.yml index 12b9ee3d..5b6bc4e4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,6 +22,8 @@ services: - ./data:/data # Override abx-dl's nested VOLUME so profiles persist across containers. - ./data/personas:/data/personas + # Let one-off `docker compose run` commands reuse the server's supervisor. + - tmp:/tmp/archivebox pids_limit: 2048 # avoids low systemd task caps with Chrome and parallel extractors environment: # - ADMIN_USERNAME=admin # creates an admin user on first run with the given user/pass combo @@ -122,3 +124,6 @@ services: # allow_other: 'true' # vfs_cache_mode: full # poll_interval: 0 + +volumes: + tmp: