-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
RunCommandService : TermuxService terminates before command completion #2081
Comments
This is not a bug in You need to do new String[]{"install", "-y", "jq", "gettext", "curl", "openssh"} |
Thank you so much ... it is working now 👍 One more question @agnostic-apollo |
Welcome. Set new String[]{"-c", "pkg install -y jq gettext curl openssh; curl -s url; command 3;"} You must add a semi-colon |
Thank you again @agnostic-apollo ... all is understood now from wiki link you shared :) One more issue just appeared when I updated termux app and please can you help me with this also ... Following is the output from termux terminal Welcome to Termux! Community forum: https://termux.com/community Working with packages:
Subscribing to additional repositories:
Report issues at https://termux.com/issues The Google Play version of the Termux app no longer cp: cannot stat '/data/data/com.termux/files/home/.termux/termux.properties': Permission denied Issue here is that I already updated the termux.properties with allow-external-apps via adb and even if I try to run the above command to set value to true it gives permission denied... Below is the output when try to run service 2021-05-25 02:00:44.102 19068-19247/com.qodit.mobileproxy D/PluginResultsService: Execution id 1001 result:
|
This error means that you didn't changed this property in |
I just solved this issue ... it was due to wrong permissions to ~/.termux using below command |
That's likely where your problem is. I assume you ran commands with
|
I did change this property to true ... but as @agnostic-apollo said I ran commands with root permissions and that's why I couldn't access the .termux folder ... |
@agnostic-apollo Thank you for your support :) now I understand the issue properly and have solved the problem ... |
welcome :) |
@agnostic-apollo
any shell command or something like this?? |
When you install (not update) termux, bootstrap has not been set up. |
Is there any way to setup bootstrap via some adb command? |
For testing it might be possible with |
How can we run commands as SU via RunCommandService ?? |
Either create your own custom script that calls |
Again thank you :) it worked 👍 |
I once again need your help @agnostic-apollo
this all is ok .. but now issue is of termux.properties file .. I tried to set allow-external-apps to true via add shell as root user as I was unable to access or write it without root user .. so now how can I make it work without interaction with termux shell and run the commandService from my app?? |
You could do |
I get this following error : adb shell 'run-as com.termux sh -c "mkdir -p /data/data/com.termux/files/home/.termux; echo allow-external-apps=true >> /data/data/com.termux/files/home/.termux/termux.properties"' |
Yes, because release builds are not debuggable. You need to build a such yourself or obtain a development snapshot from Github Actions, e.g. this https://github.com/termux/termux-app/suites/2809748693/artifacts/62504662. |
ahhh yes I also thought so .. |
As xeffyr mentioned, can't use
But then again, all these "hacks" with adb/root would only work for your personal app/mobile environment, don't expect them to work or don't use these design for production apps. |
Hi exec("/data/data/com.qodit.mobilespy/files/usr/bin/login"): No such file or directory this is the error which I get after changing package name ... |
Check #1983 |
I tried the steps and here I got this error and url not found/ : Downloading http://deb.debian.org/debian/pool/main/a/apt/apt_2.3.5.tar.xz |
The reason is already mentioned here.
Either change url and update patches if necessary yourself and if you can't, wait for someone else to do it when they update |
Ahh sorry I missed this .. I will try to update myself .. |
I successfully managed to build bootstrap packages and changed the package name also. how to use this sudo with our changed package name? |
@bilalilyas90 Adjust following line to match your new package name: https://github.com/agnostic-apollo/sudo/blob/master/sudo#L1 |
Thank you @xeffyr it worked |
Bootstrap packages were built successfully but now I am getting this following error of 403 when using pkg install? |
Why you think that Termux should allow usage of its hosting capabilities by unaffiliated projects? You need to build not only bootstrap packages but all other packages which you consider necessary and create own repository. |
Ok I understand your point .. |
Can you please guide me how to create my own repository ? I have a server but I am confused how to create my own repository and upload to server? |
I am getting this error also and here it still says permission denied for com.termux package which I already changed everywhere? |
Its regular Debian (apt) package repository, there no any Termux-specific guides. Internet is has lots of articles about building own Debian repositories with various tools. We use Aptly, its website provides a complete docs about its commands, start from https://www.aptly.info/doc/commands/. Sample
Creating repository:
Adding packages:
Publishing (first time):
Details on how to use gpg for signing are omitted. Search for guides on how to create Publishing (updating published repo):
Notes:
If you have invalid package name in deb files, then how you built bootstrap packages? Here is what should be done and expected steps order:
You can use Remember that:
|
@xeffyr I followed the steps provided by @agnostic-apollo in this link I think this create apt repository step was not done and can this be the issue? because I changed the package from properties.sh and searched for com.termux occurrences and changed that too.
So first I should create apt repository as guided by you and then then changed the repository url and then create bootstrap packages again? |
No, the mentioned steps applicable only for official bootstrap generation script. If you managed to create bootstrap archive without apt repository, ok. But make sure that all packages have
After changing prefix, you won't be able to install the original Termux packages anymore. External packages (i.e. installed with
Since you already have working bootstrap set, you need only to create apt repository and replace URLs. However if you think that application will use only specific packages, you can go with alternate approach such as extending the bootstrap set. This will allow you to omit the requirement of setting up own apt repository but will require disabling package manager and handle environment updates on application side. |
Following is the code which I am executing from my app .... command executes successfully but it exits before completion i.e it doesn't download the packages fully using pkg install commands and exits the service.
this is the output from logcat
2021-05-24 03:32:27.250 28306-7451/com.termux I/termux-task: [7448] starting: [/data/data/com.termux/files/usr/bin/pkg, install -y jq gettext curl openssh]
2021-05-24 03:32:29.643 28306-7451/com.termux I/termux-task: [7448] stdout: Checking availability of current mirror: ok
2021-05-24 03:32:29.659 28306-7450/com.termux I/termux-task: [7448] stderr:
2021-05-24 03:32:29.659 28306-7450/com.termux I/termux-task: [7448] stderr: WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
2021-05-24 03:32:29.659 28306-7450/com.termux I/termux-task: [7448] stderr:
2021-05-24 03:32:32.627 28306-7451/com.termux I/termux-task: [7448] stdout: Get:1 https://k51qzi5uqu5dg9vawh923wejqffxiu9bhqlze5f508msk0h7ylpac27fdgaskx.ipns.dweb.link stable InRelease [14.0 kB]
2021-05-24 03:32:35.393 28306-7451/com.termux I/termux-task: [7448] stdout: Hit:2 https://grimler.se/game-packages-24 games InRelease
2021-05-24 03:32:35.558 28306-7451/com.termux I/termux-task: [7448] stdout: Hit:3 https://grimler.se/science-packages-24 science InRelease
2021-05-24 03:32:35.683 28306-7451/com.termux I/termux-task: [7448] stdout: Fetched 14.0 kB in 6s (2333 B/s)
2021-05-24 03:32:35.707 28306-7451/com.termux I/termux-task: [7448] stdout: Reading package lists...
2021-05-24 03:32:35.711 28306-7451/com.termux I/termux-task: [7448] stdout: Building dependency tree...
2021-05-24 03:32:35.711 28306-7451/com.termux I/termux-task: [7448] stdout: Reading state information...
2021-05-24 03:32:35.711 28306-7451/com.termux I/termux-task: [7448] stdout: All packages are up to date.
2021-05-24 03:32:35.716 28306-7450/com.termux I/termux-task: [7448] stderr:
2021-05-24 03:32:35.716 28306-7450/com.termux I/termux-task: [7448] stderr: WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
2021-05-24 03:32:35.716 28306-7450/com.termux I/termux-task: [7448] stderr:
2021-05-24 03:32:35.723 28306-7451/com.termux I/termux-task: [7448] stdout: Reading package lists...
2021-05-24 03:32:35.724 28306-7451/com.termux I/termux-task: [7448] stdout: Building dependency tree...
2021-05-24 03:32:35.724 28306-7451/com.termux I/termux-task: [7448] stdout: Reading state information...
2021-05-24 03:32:35.727 28306-7451/com.termux I/termux-task: [7448] stdout: The following package was automatically installed and is no longer required:
2021-05-24 03:32:35.727 28306-7451/com.termux I/termux-task: [7448] stdout: oniguruma
2021-05-24 03:32:35.727 28306-7451/com.termux I/termux-task: [7448] stdout: Use 'apt autoremove' to remove it.
2021-05-24 03:32:35.728 28306-7451/com.termux I/termux-task: [7448] stdout: 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2021-05-24 03:32:35.729 28306-7451/com.termux I/termux-task: [7448] exited normally
Any help please?
The text was updated successfully, but these errors were encountered: