I want to start a windows service written in golang on my Windows server build 1803. The golang script uses the service wrapper found here: https://github.com/kardianos/service
The service is located at C:\Program Files\Monitoring\monitor.exe
.
After deploying the monitoring binary to the above location, I have created the service:
New-Service -Name "winmon" -BinaryPathName 'C:\Program Files\Monitoring\monitor.exe' -DisplayName "Prometheus Docker monitoring" -Description "Prometheus Docker monitoring" -StartupType Automatic
But starting the service on the server failed anyhow. I specified LocalSystem
as LogOn user as well as a custom CI user, which is member of the group administrators. For LocalSystem
the Service Manager will respond with The operation on winmon failed with exit code: 1067.
, which is described as Process terminates unexpectedly
. With the custom CI user I got Error Code returned: 15
, which is described as invalid drive.
Testing the above instructions on my local machine with Powershell run as administrator just works fine. Even if I switch the LogOn user to LocalSystem
, everything is running smoothly.
How can I resolve the issues on my Windows server?