Skip to content

cli: add Windows daemon spawn path for phantom start #7

@MasonStation

Description

@MasonStation

phantom start daemonizes the proxy using CommandExt::process_group(0) — Unix-only syscall.

Location

  • phantom-cli/src/commands/start.rs:52-57

Fix

Gate the existing code with #[cfg(unix)]. Add #[cfg(windows)] path using Windows creation flags so the proxy survives the parent's exit:

use std::os::windows::process::CommandExt;
const DETACHED_PROCESS: u32 = 0x00000008;
const CREATE_NO_WINDOW: u32 = 0x08000000;
cmd.creation_flags(DETACHED_PROCESS | CREATE_NO_WINDOW);

Also verify the PID-file lock handling still works — Windows does not recycle PIDs the same way Linux does, so the stale-PID check may need adjustment.

Severity

Functional gapphantom start will not run detached on Windows.

Tracker: #1

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestwindowsWindows platform support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions