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
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?
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.