I´m tryinmg to execute a .run file in my client, its a instalation of an agent, accordnig with the documentation this the command for a silence instalation.
Any exit code comes from the application that is being run. You would have to check the .run for its exit codes as that is where any value would be coming from, or from sh or bash. The 127 code is a command not found. Both command lines are using the current directory as a reference but the “current directory” when running an action is the source site of the fixlet you ran.
The bash line is a bit confusing as well as you don’t really need to run sh again in the bash shell.
CWD will depend on the site and how you issued the action. It’ll be somthing like /var/opt/BESClient/__BESData/CustomSite_MySite1
Or /var/opt/BESClient/__BESData/mailboxsite
Or /var/opt/BESClient/__BESData/opsite101
Same issue - exit code 127 in Linux means the executable was not found. BigFix is running without a shell environment, which seems to be a dependency for running shell scripts.
Try wait /bin/sh /myscript.sh
That explicitly invokes the shell to run the shell script.
Yes, that is action script. If you’re not already familiar with it, then Distribution might be best.
@JasonWalker’s advice in this other thread might be instructive.
I suggest starting with a simple shell script that sends output to a file, so that you can see what’s going on when Distribution executes a shell script.
Start with a script that only touches a file; does that work?
Have the script print its working directory to an output file. That tells you the file path where Distribution executes from.
Have the script print the location of the script itself. (You can do this with bash variables.)
etc.
Having built the familiarity about Distribution’s shell environment, an adept shell scripter should be able to make the installer do what it needs.
(Unfortunately, I think you’ve discovered that using shell scripts with Distribution isn’t a common usecase on the forum.)