Open myfreax opened 3 years ago
Manda comado bom
Help
I experienced a similar issue with calling any scripts I'd written from inside the boot script, but calling any builtin command or pkg application was fine. What I ended up doing as a workaround was to embed all the script code inside the boot script. Nothing else I tried seemed to work including nohup sh and & The script permissions were set to 0700. The commands I called successfully from inside the script are
It's probably worth noting that it was on a Motorola G6 and judging from other issues like this these are platform specific problems. On the G6 I had to disable battery optimisation but there is no specific permission for startup. I used com.termux_118.apk and com.termux.boot_7 packages from FDroid
Are there any other suggestion as to what might cause this kind of behaviour?
Are there any other suggestion as to what might cause this kind of behaviour?
Assuming you are not running with sudo then issues could be caused my invalid shebangs. For termux-boot shebang needs to be valid, so for example #!/data/data/com.termux/usr/bin/bash
instead of #!/usr/bin/bash
This works for me:
#!/data/data/com.termux/files/usr/bin/sh
sudo -u root /system/bin/sh -c "your_command_here"
Problem description startup script not execute when Andorid restart
Steps to reproduce
adb shell
then check nginx process byps | grep nginx
. Have no any output netease-proxy.shThe script can not execute When Andorid system started. I try manual start termux-boot-app, startup script executed and start app.js and sshd. But
sudo nginx
not start. When try executed script./netease-proxy.sh
in termux terminal it work well nginx.confuser root; worker_processes 1;
error_log logs/error.log;
error_log logs/error.log notice;
error_log logs/error.log info;
pid logs/nginx.pid;
events { worker_connections 1024; }
http { include mime.types; default_type application/octet-stream;
}
Packages CPU architecture: aarch64 Subscribed repositories:
sources.list
deb https://grimler.se/termux-packages-24/ stable main
game-repo (sources.list.d/game.list)
deb https://dl.bintray.com/grimler/game-packages-24 games stable
science-repo (sources.list.d/science.list)
deb https://dl.bintray.com/grimler/science-packages-24 science stable Updatable packages: apt/stable 2.2.2 aarch64 [upgradable from: 2.1.18] ca-certificates/stable,stable 20210413-2 all [upgradable from: 20210125] curl/stable 7.76.1 aarch64 [upgradable from: 7.75.0-1] dialog/stable 1.3-20210324-0 aarch64 [upgradable from: 1.3-20200327-0] game-repo/stable,stable 1.3 all [upgradable from: 1.2] inetutils/stable 1.9.4-11 aarch64 [upgradable from: 1.9.4-10] libcurl/stable 7.76.1 aarch64 [upgradable from: 7.75.0-1] libgcrypt/stable 1.9.1 aarch64 [upgradable from: 1.8.7] libnettle/stable 3.7.2 aarch64 [upgradable from: 3.7] nano/stable 5.6.1 aarch64 [upgradable from: 5.5] ncurses/stable 6.2.20200725-2 aarch64 [upgradable from: 6.2.20200725-1] openssl/stable 1.1.1k-2 aarch64 [upgradable from: 1.1.1i] psmisc/stable 23.4 aarch64 [upgradable from: 23.3-2] science-repo/stable,stable 1.2 all [upgradable from: 1.1] tar/stable 1.34 aarch64 [upgradable from: 1.32-6] termux-exec/stable 1:0.9 aarch64 [upgradable from: 1:0.8] termux-tools/stable,stable 0.118 all [upgradable from: 0.104] Android version: 7.1.2 Kernel build information: Linux localhost 3.10.84-perf-gc8921aa #1 SMP PREEMPT Sat Dec 1 00:17:25 CST 2018 aarch64 Android Device manufacturer: nubia Device model: NX569J