3

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?

semaph0r
  • 131
  • 4
  • Missing runtimes or other dependencies maybe? Have you tried running the executable interactively to see what happens? Failing that, Process Monitor (available from the MS web site) might be useful in troubleshooting the source of the problem. – Harry Johnston May 08 '19 at 19:13

0 Answers0