I have a script "getFiles.sh" containing the following:
ping -c 2 192.168.0.103
if [[ $? == 0 ]];
then /usr/bin/tftp 192.168.0.103 -c get file1.json file2.json file3.json;
else exit 1;
fi
I have tftp-hpa installed on Ubuntu 18.04 (running node-red snap).
When I run this script in a terminal as my user account it works fine.
When I call the script from an Exec node in node-red the pings work fine and then I get the following:
code: 127
message: "Command failed: bash getFiles.sh↵getFiles.sh: line 6: /usr/bin/tftp: No such file or directory↵"
Any ideas would be appreciated..
Edit: Additional info - permissions set to 755 for tftp
Likely not the issue: if you’re running node-red within snap, have you checked that you have access to this command from within your snap container? Try which tftp in an exec node.
The goal of Snap is to run programs in an isolated environment, meaning the node-red install has no access to other programs installed on your machine, not by default at least.
I'm new to snap, when trying to fix the issue yesterday I set the permissions as follows. None of these seem to indicate access to other applications or /usr/bin.
Yes correct, that’s exactly what snap is for: running completely sandboxed applications that can only interact with the host system to interfaces. Security is the primary goal of that, so allowing access to /usr/bin on the host comes with risks.