I've got this issue on my Home Assistant installation. While I'm connected to the ssh addon I can run a command like this
docker exec ipmidocker /home/ipmidocker/ipmi_pub.sh
it works just fine but if I try to put that command in a script and try to execute the script from the same shell that I used before I got this error.
: no such file or directory: unknown: container_linux.go:380: starting container process caused: exec: "/home/ipmidocker/ipmi_pub.sh\r": stat /home/ipmidocker/ipmi_pub.sh
I've already tried to put the script inside one of the directories defined as $PATH of the target container, I even tried to generate a binary from the script but I've always got an error like this one:
OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: ***: executable file not found in $PATH: unknown
I've tried to put inside the script the directly a command that I know will work on that container but I've got the same error all over again.
This has something to do with the specific container I'm working on because the same approach works fine on other containers such as the NUT addon...
Any advice on wherever try to get some helpfull information will be appriciated
CodePudding user response:
Looks like you have a \r
character at the end of the path.
I'm guessing you are working on Windows then.
Windows uses \r\n
to signal the end of a line, while other systems use only \n
.
You need to remove the \r
so you are left with only a \n
.
You can probably do that with some setting in the text editor you are using. or just editing the file with sed like this: sed $'s/\r$//' <file> > <file>.unix