mirror of
https://github.com/qdm12/ddns-updater.git
synced 2026-08-02 18:48:49 -04:00
Feature request: run as windows service #527
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @shikulja on GitHub (May 19, 2025).
When the application is installed and run as a Windows service without using nssm, it often hangs in the "Starting" state and never fully transitions to "Running." This happens because the application is not designed to properly interact with the Windows Service Control Manager (SCM) interface.
Specifically:
Windows services must respond to SCM control requests (like Start, Stop, Pause) and report their status changes promptly.
A service application needs to call StartServiceCtrlDispatcher and implement a service main function that communicates with the SCM.
If the application is a regular console or GUI program that does not implement the Windows service protocol, SCM will wait indefinitely for a successful start notification.
Without this handshake, SCM assumes the service is stuck, leaving it in the "Starting" state.
nssm works around this by acting as a service wrapper: it runs the console application as a child process and handles SCM communication itself, preventing the service from hanging.
@shikulja commented on GitHub (Jun 8, 2025):
It is possible to do this using third-party programs. But I found it non-trivial for such a simple task.
nssm+powershell
ddns-updater.zip