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
append
to