VMware Cloud Community
Lam_bui
Contributor
Contributor

Child process exit abnormally when calling external scripts

Hello,

When calling external scripts (bash for example), I get child process exited abnormally, like below. If I add the ' &'  at the end of the scripts, it would be okay of course like stated in the guide page. I do not want to add the & because I need the script to be completely done first, error ot, before I can move on. I don't want the process to run in the background for particular scripts. From my limited researching, I see this error is expected if the script is exited with a negative return code or it's not ' 0' , so the installer take that as an error and reported it this way? I like to know how can we ' fix'  this error, or somehow tell the installer that the script with exit code ' 1234'  is okay.


07-09-2019 10:42:49: Error running /bin/sh ' scripts.sh' : child process exited abnormally



<!-- Append &amp; to the arguments so the program is executed in the
       background and the parent process, the installer, can successfully
       end. If you do not launch it in background, the installer will remain
       running until the launched application is closed -->


Labels (1)
0 Kudos
3 Replies
AnonymousDefaul
Enthusiast
Enthusiast

Hi Jake,

You can tell the installer how to treat error running external programs using the properties <abortOnError>, <showMessageOnError> or the <onErrorActionList>. You can find more details and examples at this section of our docs:

https://clients.bitrock.com/installbuilder/docs/installbuilder-userguide.html#_handling_action_error...

Could you check if that works for you?

Regards,

Alejandro

0 Kudos
Lam_bui
Contributor
Contributor

Hi,

I already set the abortOnError and ShowMessageOnError to '0' like below. Is there an option to  or ' suppress or '  a certain error code?

0 Kudos
AnonymousDefaul
Enthusiast
Enthusiast

Hi Jake,

`<runProgram>` defines a set of variables after executing:

https://clients.bitrock.com/installbuilder/docs/installbuilder-userguide.html#_running_external_prog...

You could silence errors as you are currently doing, and then check `${program_exit_code}` and decide what to do. For example, if  or ' 2 or '  exit code is acceptable, you could use the below code to throw any other invalid code:

```

   <runProgram>       <program>/bin/sh</program>       <programArguments> or ' ${installdir}/testscript.sh or ' </programArguments>       <abortOnError>0</abortOnError>       <showMessageOnError>0</showMessageOnError>    </runProgram>
   <throwError text= or ' Execution failed ${program_stderr} or ' >
      <ruleList>
        <compareValues value1= or ' ${program_exit_code} or '  logic= or ' does_not_equal or '  value2= or ' 0 or ' />
        <compareValues value1= or ' ${program_exit_code} or '  logic= or ' does_not_equal or '  value2= or ' 2 or ' />
      </ruleList>
    </throwError>

```

0 Kudos