Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (go env)?
go env Output
set CGO_CFLAGS=-g -O2
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\ARS\AppData\Local\Temp\go-build2586798521=/tmp/go-build -gno-record-gcc-switches
What did you do?
Build the SVC example from golang.org/x/sys
Install the service on Windows 10: .\example.exe install
Open services.msc, find my service
Start it as it is (using Local System Account by default) (starts normally, no error)
Open its properties and switch to the Log On tab
Assign a local user who is NOT a member of the Administrators group (has no admin rights). Check that he owns the Log on as service permission in Local Security Policy, but Windows will grant it automatically at this step if needed.
Start the service (and observe the error 1053 popup message)
What did you expect to see?
The example service my service to start normally.
What did you see instead?
Windows popup error message:
Error 1053: could not start service: The service did not respond to the start or control request in a timely fashion.
also when starting from command line .\example.exe start:
failed to start myservice: could not start service: The service did not respond to the start or control request in a timely fashion.
My investigation (possible reason)
I'm not a go developer, but tried to build the svc example from some previous versions of golang.org/x/sys based on the commits history and tracked down that this issue may because this commit on Oct 8, 2020: windows/svc: add IsWindowsService function
I assume because when building the svc example from one earlier state - right before that commit - this issue not exists, the service can start with my dedicated test user without any problem.
Real-world example of this issue (Gitea)
As I said I'm not a go developer (js actually), I am a user of a go project called Gitea, where me and many other users faced this problem with recent versions of Gitea and reported this issue first there. Gitea can be installed as a Windows service and it operated well for a long time. After our discussion, it became clear that the problem is independent of the Gitea code, so I was asked to report the issue here too.
My OS version
Windows 10 Pro version 20H2 build 19042.964
The text was updated successfully, but these errors were encountered: