[PR #1732] Fix hook file overwrites in plugin directory #2990

Closed
opened 2026-03-01 18:01:20 +03:00 by kerem · 0 comments
Owner

Original Pull Request: https://github.com/ArchiveBox/ArchiveBox/pull/1732

State: closed
Merged: Yes


Multiple hooks in the same plugin directory were overwriting each other's stdout.log, stderr.log, hook.pid, and cmd.sh files. Now each hook uses filenames prefixed with its hook name:

  • on_Snapshot__20_chrome_tab.bg.stdout.log
  • on_Snapshot__20_chrome_tab.bg.stderr.log
  • on_Snapshot__20_chrome_tab.bg.pid
  • on_Snapshot__20_chrome_tab.bg.sh

Updated:

  • hooks.py run_hook() to use hook-specific names
  • core/models.py cleanup and update_from_output methods
  • Plugin scripts to no longer write redundant hook.pid files

Summary

Related issues

Changes these areas

  • Bugfixes
  • Feature behavior
  • Command line interface
  • Configuration options
  • Internal architecture
  • Snapshot data layout on disk

Summary by cubic

Prevented hook file collisions by giving each hook its own stdout, stderr, pid, and cmd filenames. This fixes mixed logs and ensures correct cleanup and status checks when multiple hooks run in the same plugin directory.

  • Bug Fixes
    • hooks.py: write hook-specific stdout/stderr/pid/cmd files and exclude them from new_files; derive cmd.sh from pid for safe kill.
    • core/models.py: read hook-specific logs; exclude hook output files when computing outputs; cleanup and background detection use *.pid.
    • Plugins: stop writing redundant hook.pid files; minor chrome utils cleanup.

Written for commit 754b096193. Summary will update on new commits.

**Original Pull Request:** https://github.com/ArchiveBox/ArchiveBox/pull/1732 **State:** closed **Merged:** Yes --- Multiple hooks in the same plugin directory were overwriting each other's stdout.log, stderr.log, hook.pid, and cmd.sh files. Now each hook uses filenames prefixed with its hook name: - on_Snapshot__20_chrome_tab.bg.stdout.log - on_Snapshot__20_chrome_tab.bg.stderr.log - on_Snapshot__20_chrome_tab.bg.pid - on_Snapshot__20_chrome_tab.bg.sh Updated: - hooks.py run_hook() to use hook-specific names - core/models.py cleanup and update_from_output methods - Plugin scripts to no longer write redundant hook.pid files <!-- IMPORTANT: Do not submit PRs with only formatting / PEP8 / line length changes. --> # Summary <!--e.g. This PR fixes ABC or adds the ability to do XYZ...--> # Related issues <!-- e.g. #123 or Roadmap goal # https://github.com/pirate/ArchiveBox/wiki/Roadmap --> # Changes these areas - [ ] Bugfixes - [ ] Feature behavior - [ ] Command line interface - [ ] Configuration options - [ ] Internal architecture - [ ] Snapshot data layout on disk <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Prevented hook file collisions by giving each hook its own stdout, stderr, pid, and cmd filenames. This fixes mixed logs and ensures correct cleanup and status checks when multiple hooks run in the same plugin directory. - **Bug Fixes** - hooks.py: write hook-specific stdout/stderr/pid/cmd files and exclude them from new_files; derive cmd.sh from pid for safe kill. - core/models.py: read hook-specific logs; exclude hook output files when computing outputs; cleanup and background detection use *.pid. - Plugins: stop writing redundant hook.pid files; minor chrome utils cleanup. <sup>Written for commit 754b09619329c0b0b7aa3f32227d14d681e3e6f0. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. -->
kerem 2026-03-01 18:01:20 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ArchiveBox#2990
No description provided.