Skip to content

[Bug] Missing SIGHUP handler leaves daemon uncleanly terminated #147

@Jensenwgd

Description

@Jensenwgd

Bug: Missing SIGHUP handler leaves daemon uncleanly terminated

Location: packages/hub/src/daemon.ts lines 203-211

Problem: The daemon registers handlers for SIGTERM and SIGINT but not SIGHUP. When a user closes the terminal window on Windows, SIGHUP is sent but cleanup() is never called, leaving:

  • Orphaned Windows Firewall rules
  • Leftover hub.pid and hub.json files
  • Stuck sleep prevention flag
  • Orphaned node processes

Suggested fix: Add SIGHUP handler alongside existing SIGTERM/SIGINT:

process.on("SIGHUP", () => {
  cleanup();
  process.exit(0);
});

Environment: Windows 11 + WSL2 (Hyper-V), Node.js 20.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions