Get The Scoop On What's New
Want to know what Plugins4Automate is doing for ConnectWise Automate? Come check out our blog and find out about new products and updates that we are working on! https://www.plugins4labtech.com/blogs/blog

Killing LTSVC.exe

Supports the detector plugin and any feature or other requests around the plugin.
Post Reply
DomoB90
Posts: 15
Joined: Mon Sep 09, 2019 8:19 pm

Killing LTSVC.exe

Post by DomoB90 » Wed Jan 15, 2020 9:33 pm

Hi there,

It would appear the script stops and starts the services easily but I've tested this on numerous stalled agents and I get the same response each time. I don't understand. LTSVC.exe is definitely on the machine(s).

I've logged into a stalled agent PC and I can see LTSVC.exe running. Is there a reason why this error could be occurring?

Starting Screen Connect connections to *PC Name Here*, Sending wakeup call
Lets give the wake up call a few seconds to do it's job
Agent Online time in second (if a negitive number then it is the number of seconds offline) -> 76589
Sending Windows commands to restart the LT Agent
Stopping LTService ->
C:\Windows\system32>net stop ltservice
The SADOS Managed Services service is stopping.
The SADOS Managed Services service was stopped successfully.


Killing LTSVC.exe ->
C:\Windows\system32>taskkill /im LTSVC.exe /f
ERROR: The process "LTSVC.exe" not found.


Starting LTService ->
C:\Windows\system32>net start ltservice
The SADOS Managed Services service is starting.
The SADOS Managed Services service was started successfully.



All commands completed.

Edit: I did log on and opened an elevated command prompt and run taskkill /im LTSVC.exe /f manually to test. This succeeded.

User avatar
Cubert
Posts: 1348
Joined: Tue Dec 29, 2015 7:57 pm
Contact:

Re: Killing LTSVC.exe

Post by Cubert » Fri Jan 17, 2020 2:13 pm

This is by design!


We can not consider that the LTSVC will actually respond to a shutdown command. If the LTAgent is "Dead" then some times a restart will not do the trick. So we first try to shut down the agent nicely, if it shuts down then the agent service is currently off when we issue the KILL command. The Kill command will fail (Good) and then we restart the service.

But, If the Shutdown command failed to do that nicely, The LTSVC will still be a stuck process running failed in the background so the Kill command should catch it and stop service. Then nicely restart the service again and service is restored.

So the Kill Failure is actually a good sign that the agent was responding to commands. If you see Kill Succeeded success then you will know that the agent did not respond to a nice call to stop services and we had to hard kill it.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest