This is what I am trying or have tried in Action Script. I got the chmod to work using the 755. It's the actual running of the .bin that isn't working.
Hi @mikinvestigator When passing a quoted command string to sh -c, it's often easiest to wrap the entire command in double quotes, and use single quotes for internal strings that need literal interpretation (e.g., filenames with spaces). Therefore you can have the Inventory.xml in the outc within single quotes as an option.
When I do that, I get this error even though ls -l shows it in there and I can run the command directly on the server
Command failed (child exec() failed (errno is 2: No such file or directory
Hi @mikinvestigator this error usually means that the executable file itself, a library it depends on, or the shell used to run it is missing or the path to it is incorrect. Can you validate your wait command of /bash/sh -c is correct? I believe it should be /bin/sh -c or /bin/bash -c.
I do have the chmod +x command first. I realized I forgot the ending " so I ran it again and I am getting the command succeeded with Exit Code 127 but XML file still isn't generated.
There's probably still something wrong in the quoting. Instead of sorting out what's going on with the shell quoting it's probably easier to generate a script and run the script, so you don't need to worry about spaces and quoting parameters.
Also, on what operating system are you running this?
This will create a shell script to run the commands, run them, and save both stdout and stderr output to the file in tmp so that if there is still an error, you might be able to retrieve the error message.
It also spawns /bin/sh as a 'login' shell, which processes dot-files that might provide some PATH or environment variable upon which that BIN relies.
edit: I edited my copy-paste to use relative paths for the downloaded file, be sure to use that update. And also you need to actually have whatever download command is downloading that .BIN file for you first.
This is for OS RHEL 9. I tried running what you have above and there that is generated is this. Why would it work when I run it manually but not through BigFix? ./_Download/invcol_LN64_K4KWG_25_12_00_37_A00.BIN: line 42: exec: xterm: not found
Not sure. Maybe xterm is coming from a graphical desktop environment? It's not clear to me what this utility is, or why it should open an xterm, that seems like it would be difficult to automate.
It isn't anything that gets installed, it's a BIN file that scans to get the Dell Drivers and save the information into an XML file. The Operating System is RHEL9
I tried a route that doesn't assume the site will be actionsite and uses relevance substitution to create the command. I get exit 127 but my RHEL lab is a HyperV but you may want to try it.
prefetch invcol_LN64_K4KWG_25_12_00_37_A00.BIN sha1:2c8b7698ae6b42ecc11f04132799ca0e9b3d2db1 size:356534159 http://<fqdn>:52311/Uploads/Files/invcol_LN64_K4KWG_25_12_00_37_A00.BIN sha256:4b5ee8ca85393187513226aafd2769a1bccf2b42a857717288acbd960464c182
wait /bin/bash -c "chmod +x {(pathname of client folder of current site) & "/__Download/invcol_LN64_K4KWG_25_12_00_37_A00.BIN"}"
wait /bin/bash -c "{(pathname of client folder of current site) & "/__Download/invcol_LN64_K4KWG_25_12_00_37_A00.BIN -outc=/var/opt/BESClient/Inventory.xml -comptype=BIOS,APAC,FRMW"}"
What does line 42 of the BIN file say? My guess is xterm is not in your path, and that is why it is failing at this point. This also brings up the question, have you run this from the command line successfully? If so, when you run this, does it pop open a new window?