Skip to content

[Windows] 通过 start /B 后台启动后无法停止服务:stop 只认 PID 文件,而该文件在 Windows 上不会被生成 #12

Description

@Allen141025

运行环境

  • 操作系统:Windows 11
  • Python:3.12.1
  • ProtoForge:1.3.0(源码运行,非 Docker)

问题描述

在 Windows 上,protoforge stop 停止服务的唯一依据是 data/protoforge.pid,而该文件的唯一写入点在 protoforge/cli.py:580,位于 if daemon: 分支内。但同一分支开头(cli.py:572-575)在 Windows 上会直接打印提示并 return:

    if daemon:
        if sys.platform == "win32":
            print("! Daemon mode is not supported on Windows. Use 'start /B' or run as a service.")
            print("  On Linux/macOS, use: protoforge demo --daemon")
            return

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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