Killing LTSVC.exe

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

Killing LTSVC.exe

Post by DomoB90 »

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: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Killing LTSVC.exe

Post by Cubert »

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.

DomoB90
Posts: 20
Joined: Mon Sep 09, 2019 8:19 pm
4

Re: Killing LTSVC.exe

Post by DomoB90 »

Ah, okay. That makes sense. Thank you for clearing that up.

As a follow-up question then, so it shows it succeeded but the offline LT agent tab is still showing it offline 10 minutes after refreshing. I pulled the console up and it shows it offline as well. ScreenConnect is online obviously, but I can't query any inventory or anything from the LT agent still.

How long should it take to come back up? It's doing this for all the stalled agents I'm trying on.

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

Re: Killing LTSVC.exe

Post by Cubert »

Sometimes restarting the agent doesn't fix it and only fix is to reboot agent manually.

DomoB90
Posts: 20
Joined: Mon Sep 09, 2019 8:19 pm
4

Re: Killing LTSVC.exe

Post by DomoB90 »

I was afraid that would be the answer. :(
Thank you!

Post Reply

Return to “Stalled Agents Detector Plugin”