-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Termux scripts crash when launched from Tasker/Llama (Android 8) #464
Comments
I'm still gathering information on this, but it appears that since Termux was upgraded, symbolic links that point to relative paths could be causing this issue. The scripts related to this issue are kept in /data/data/com.termux/files/home/scripts with a symbolic link in $HOME/.termux/tasker pointing to ~/scripts/SCRIPT_NAME instead of the full path. Removing the relative path (~/) and replacing it with /data/data/com.termux/files/home/scripts appears to have solved this issue. I don't think this is closed as the issue is very unpredictable. The job can work fine for several hours and then suddenly crash, requiring the editing step mentioned above. |
Thanks for reporting! Can you check if the just released version 0.3 of Termux:Tasker fixes the issue? It should be available as an update from Google Play within a few hours max (and from F-Droid within a day or two). |
I have a similar problem. I created a script, placed it in e[95mChecking Open GApps configuration and version ...\e[39m
/data/data/com.termux/files/home/.termux/tasker/ogus.sh: 25: [[: gapps: unexpected operator
-e \e[91mERROR: This script only updates Open GApps. On current system, the Open GApps are not installed.\e[39m
[Process completed (code 2) - press Enter] The problem lays in this line:
On the particular line, there is an I even changed shebang from Current version of the script can be found here. I use latest app versions of Termux, Termux-tasker, Tasker installed from Google Play and all my packages are updated. |
@tukusejssirs you can get rid if the [[ error with "$type" instead of $type. That won't fix the second error though. Your device probably doesn't have the /system/etc/g.prop file |
(1) Quoting variable does not work. Which is expected by me, because shell keyword (2) The scripts works as expected when running directly from Termux. (3) It is a script created by me. I want to create a sort of cronjob on Android using the Tasker. (4) The second error is a result of non-available programs. I use ============ The expected solution: availability of all installed programs. |
Info, how Termux distinguish binaries and scripts: https://github.com/termux/termux-app/blob/master/app/src/main/java/com/termux/app/BackgroundJob.java#L138-L183 - as in (2), shebang is read at the first line. |
@xeffyr is right. In Termux, the shebang must be on the first line. To answer your question: I am accustomed to have all general comments written at the beginning of the scripts before the shebang. I never had this experience / these issues on (desktop) Linux, therefore I presumed the same behaviour on Termux, too. I see I was wrong. Now I know that I can leave the shebang as Thank you! :) |
When you use shell (like bash) in interactive mode, you can omit shebangs at all. In this case scripts will be executed with your current shell. (in that case you are not wrong) Plugins like Termux:Tasker ask Termux to execute file manually. To support many script types, Termux read the first line of file and determines the right interpreter to execute it. So here shebangs should always exist on the first line of scripts. |
I thought it should do it this way: search first non-blank and non-comment line. |
ISSUE:
Scripts in the ~/.termux/tasker path launch from Tasker or Llama can be launched and work properly most of the time. Occasionally a job crashes when launched from Tasker or Llama. When the job crashes, the job will not run again from Tasker or Llama until the job is edited via the Termux:Task interface; this does not always work. The script can always be run through a terminal/ssh session without issue.
Crash Information (is there a better way to get this information other than manually typing it in?):
Stack Trace (as much as I could bare to type in):
java.lang.Runtime.Exception: Unable to start receiver com.termux.tasker.FireReciver: java.lang.IllegalStateException: Not allowed to start service intent { act=com.termux.service_execute dat=com.termux.file:/data/data/com.termux/files/home/.termux/tasker/rsync_nprpodcast-lan cmp=com.termux/app.TermuxService(has extras): app is in background uid UidRecord(e17e965 u0a187 RCVR bg+4m34s924ms idle procs:3 seq(424,424,424)}
Android Information:
Termux version:
<=0.48
Installed Termux apps:
Updatable packages:
All packages up to date
System information:
Linux localhost 3.18.52-g99dda0323132 #1 SMP PREEMPT Fri Aug 18 00:56:04 UTC 2017 aarch64 Android
Termux-packages arch:
aarch64
Android version:
8.0.0
Device manufacturer:
Google
Device model:
Pixel
The text was updated successfully, but these errors were encountered: