Skip to content

Failed auto restart in windows after called sing-box-cli service stop #21

Description

@AtticusZeller

append

        # Automatic startup at boot.
        subprocess.run(
            [self.nssm_bin, "set", self.service_name, "Start", "SERVICE_AUTO_START"],
            check=True,
            stdout=subprocess.DEVNULL,
        )

to

class WindowsServiceManager(ServiceManager):
    def stop(self) -> None:
        """Stop the service"""
        try:
            subprocess.run(
                [self.nssm_bin, "stop", self.service_name],
                check=True,
                stdout=subprocess.DEVNULL,
                stderr=subprocess.DEVNULL,
            )
        except subprocess.CalledProcessError:
            # Service might not be running, which is fine for a stop
            pass

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions