We were able to find some sort of solution for this problem.
The way we solved this was using NSSM, which is some kind of Windows Service Wrapper with extended functions.
Two issues were solved using NSSM:
- NSSM is using the executables path as current working directory
- NSSM is able to correctly retrieve the Agents' status (e.g. running, stopped/crashed) and report it to the Windows Service.
Additionally, you can start and stop the agent service using the native Windows Service Methods (Start-Service / Stop-Service).
Kind regards
Norbert
Original Message:
Sent: Feb 08, 2023 11:59 AM
From: NorbertZ
Subject: Running an Agent as a native Windows Service
Hello,
we are planning to get rid of the Automic Service Manager to simplify our setup.
On Linux, there already is a solution using systemd for the agent startup.
For Windows, this would mean that we need a way to run the agent (ucxjwx6.exe) as a native Windows service (sc.exe).
We already managed to install the agent as a Windows service and get the agent running.
Though, the problem is that the agent does not send a valid response to the Windows service controller.
This leads to a timeout (30s), in which the agent is being stopped by Windows.
Is there any way to run the Windows agent as a native Windows service, without using the Service Manager?
Kind regards
Norbert