Read the statement by Michael Teeuw here.
exec error: Error: Command failed: ?!
-
@stoffel yes, my config module is pretty good…
waiting for more error reports from users …because you are launching the program (bash) … the console comes to your program not to the log…
in my uploadPics module I just console.log() whatever comes back from my shell pgm…
then it shows in the MM log -
fine, i will test it at WE.
Now its time to sleep. i test tomorrow with sh … and without bash/sh -
i’v test the exec command without bash… thats not work, i have a
/bin/sh: 1: …/MagicMirror/config/test.sh: Permission deniedwith bash it works now, but the filename is a bit crazy
thats at ssh console. in filezilla the filename is correct but says no such file or directory
i have no idea what gos wrong
-
@stoffel us the file marked excecutable?
ls -laF ../MagicMirror/config/test.sh
if the file starts with the shebang, then u don’t need to use bash either
#!/bin/bash rest of script
chmod +x ../MagicMirror/config/test.sh
it is really in the config folder?
-
look at my first post, its a simple text-file with the extension .sh and its executable -rw-r–r–
the test.sh is not the problem, the file ist found and execute it. the problem was the cp command. but now i soved the problem.cp -a -v ../MagicMirror/config/config.js ../MagicMirror/config/config_1.js 1>> ./log_erfolgreich.txt 2>> ./log_fehlgeschlagen.txt pm2 restart all
i add the option -a . now its work !!
the log_erfolgreich.txt and log_fehlgeschlagen.txt are found in the MagicMirror dir, so cp starts at this dir.
the../MagicMirror/
are needed, maybe mm starts from the .pm2 dir?!
i play around with it and other files (txt, png…)
i am lucky :-)
thanks very much for your help.at WE i test your config-module and post it
-
@stoffel said in exec error: Error: Command failed: ?!:
and its executable -rw-r–r–
is NOT executable
it needs the x flag
now its executable xrwxr–xr–
there are 3 bits each
for the user themselves
for others in the same group as the user
and for ‘others’sometimes shortened to UGA
u can set the flags with
chmod the numbers 7 is all bits (777)
or just for the user 766
or read only for anyone except the user 744to turn on the execute flag for any and all its +x
(to turn it off is -x)
r and w are read and write -
@stoffel said in exec error: Error: Command failed: ?!:
its a simple text-file
unix is cool… ANYTHING can be executable… and a ‘script’ is just a text file with the executable flag on
the .sh means nothing (just convention to say shell script)I dson’t use .sh in most of my scripts, cause its just another thing the user has to type and doesn’t help
also, in unix, if the 1st line of the executable text file
starts with shebang #!
then the program to execute this ‘script’ is specified next#!/bin/bash
means bash will execute this program, so bash (/bin/bash) is launched and passed this script
-
ok, i am not a linux erpert. i think the exec command execute a script, and its work with this file-attributes. you can test it. maybe its read the file and exec the commands in it. i’v checked the attributes with filezilla, was 644, not executable but it works.
the file-attributes are for the security of RPI & MM importend. thats is for later.
at the moment ist works without errors. i can send you my files for test !?
-
@stoffel not needed… exec should fail if the execute bit is not on…(it would be a security exposure to allow ‘anything’ to execute) but not my job
-
ok, what can i say. i’v test it with other config und it works also. its overide the old config with the new config and restart mm.
i not understand why, but it works. realy