End the process of exe to move to the next line

Can anybody help in coming out of the wait command after few minutes. There is an exe We are trying to execute and process of exe keeps running even though app gets installed. While we are getting this issue fixed, I need to create a workaround so that execution comes out of wait command after few minutes.

The solution that exist are control settings _BESClient_ActionManager_OverrideDisposition & _BESClient_ActionManager_OverrideTimeoutSeconds (documentation for both here) but be careful because those are not per-action settings but instead per-client, so you set those very aggressively (like you mentioned a few mins), it will be halting ANY action that takes longer, including valid ones (for example, certain patches will take a lot longer than a few mins).

With that in mind, you are better off to use run or runhidden, instead of wait & waithidden, and build yourself logic how to handle it within the actionscript. For example, something that will pause for X mins and then run some kill command if the process is still there:

parameter “startTime” = “{now}”

runhidden “\process.exe”

pause while { (now - (parameter “StartTime” as time)) <= 5 * minute}

if {exist process “process.exe”}
dos pskill process.exe
endif

That’s good info.
On a per-fixlet basis, we do have ‘override’ options for ‘timeout’ and ‘disposition’ so you can avoid globally setting a timeout for every action. They’re described at https://developer.bigfix.com/action-script/reference/execution/override.html

2 Likes

Didn’t know that is now offered per action too. Good shout!

Coincidently, I ran into a similar issue that the previous doesn’t resolve and wanted to see if anyone know a fix for it. The issue we have is with actions of type “shell” and I would imagine it would probably exist for actions of type “Powershell” (haven’t upgraded all of our agents to this version, so not currently using it) - how do you enforce the stopping or a timeout for such actions? I saw a few 1000+ line bash script getting hung and sitting there for a month and half on a handful of machines… Anyone has any thoughts on the subject?

1 Like

This is what I am using during any package creation specifically for Linux/Unix -

//override timeout after 15 min
override wait
timeout_seconds=900
disposition=terminate
wait /var/tmp/myfile.sh

For actions of type “Actionscript” that works but what about “shell” or “Powershell”? Those are the ones I am struggling with.

Sine those aren’t native Action script, I’m afraid you’d have to handle that internally to the script itself.