Closed CasparNuel closed 2 years ago
write some working sh file here
What do you have in your sh file?
Currently, just for testing:
#!data/data/com.termux/files/usr/bin/sh
echo "hi" >> /storage/emulated/0/hi.txt
However, I have changed the content three times now, even once using the Termux:API package to show a toast - the result is always the same.
And for each change, running the script manually sh script.sh
works as expected.
Found the issue:
#!data/data/com.termux/files/usr/bin/sh
Should be
#!/data/data/com.termux/files/usr/bin/sh
Problem description
I have created the
~/.termux/boot
directory and placed my.sh
file in there withchmod o+x,g+x,u+x script.sh
to ensure there is no lack of permissions.I have opened the Termux:Boot application multiple times at this point.
Steps to reproduce
cd ~
mkdir .termux/boot
# write some working sh file here
cp ./someworkingfile.sh ./.termux/boot/script.sh
chmod o+x,g+x,u+x ./.termux/boot/script.sh
At this point, I get a screen with following information:
User action: Plugin execution command Sender: TermuxService
Execution Intent Command Previous State: Executing Current State: Failed Executable:
/data/data/com.termux/files/home/.termux/boot/script.sh
Arguments: - Working Directory:/data/data/com.termux/files/home
inBackground: True isFailsafe: False Session Action: - isPluginExecutionCommand: TrueResult PendingIntent Creator:
(all three fields have no value)
Error Code: 2 Error Message
Failed to execute "(1000) Execution Intent Command" termux task command
First line of stack trace:
java.io.IOException: Cannot run program "/data/data/com.termux/files/home/.termux/boot/script.sh" (in directory "/data/data/com.termux/files/home"): error=2, No such file or directory
But the file is there? Did I miss a step? Am I missing a vital package or setup?
Expected behavior
For the script to run at boot without error
When manually ran (
sh script.sh
) this script works perfectly.Additional information