Kaseya Community

How to change script timeout to less than 2 hours?

This question has suggested answer(s)

Is it possible to change the default script timeout to less than 2 hours? 

This comes with another question though: would this affect more than the "ExecuteShellCommand" statement?

I do deploy software that could potentially take 2 hours, but it is unlikely. However, I can't imagine needing a shell command timeout of 2 hours - ever. Occasionally, if a command was entered improperly and the STDout isn't returning, it is going to take 2 hours before I can execute another script on the machine since they execute synchronously rather than asynchronously. 


All Replies
  • I too would like to know the answer to this...

    I've actually written a script to asynchronously (cmd /c ping -n #global:timeout# && taskkill /f /im="#global:exe#") call a taskkill of whatever exe (be it an actual exe or msiexec.exe of a MSI file) that you're running via executeShellCommand in the following step.

    You can always get fancy and divide the #global:timeout# by 10 (rounded up to the nearest whole number, and after validating that #global:timeout# is > 0) and taking the absolute value of the result (so you don't divide by zero and inadvertently destroy the universe).

    No need to get fancy though... that first option works.  On any machine except XP you can even use the timeout option:

    timeout /t #global:interval# && tasklist /fi "USERNAME eq #global:username#" /fi "IMAGENAME eq #global:exe#" >> "#global:cr2#"

    ping -n #global:interval# >> nul && tasklist /fi "USERNAME eq #vAgentConfiguration.credentialName#" /fi "IMAGENAME eq #global:exe#" >> "#global:cr2#"

    This way you can "check in" with the task that's running every global:interval seconds.

    I'd post the whole script series, but it also has some elements that wouldn't make sense outside the context of my system.

    Hope this helps!

    Formatting got munged while trying to type response on phone, response was cut off
    [edited by: Brian Dagan at 12:48 PM (GMT -8) on Dec 9, 2013]
  • I would also like to know if this is possible, thanks.

  • If you want to change the timeout to something like 4 hours, do this:

    UPDATE serverInfo SET execTaskTimeoutSec=14400

    By default execTaskTimeoutSec is NULL, which apparently defaults the timeout to 2 hours. After updating the value of the column you will need to restart the Kaseya Service (kserver.exe).

    This is a setting stored on the ksubscribers database