termux-boot icon indicating copy to clipboard operation
termux-boot copied to clipboard

Termux:Boot not working on Android Oreo

Open koalaeagle opened this issue 7 years ago • 10 comments

I have opened the Termux:Boot app several times.

Termux:Boot does not appear to be working under Android Oreo. My scripts are not executed at all. I use Ansible to deploy my configuration so I can be sure it is identical as Nougat. Although, I ended up removing all of my boot scripts since I discovered that termux-wake-lock does not work either under Android Oreo. Since my primary concern is having sshd running on startup I tried making that the only line in the only script. I tried just "sshd" and also just "sshd -D", neither worked. To ensure it wasn't a problem related to sshd I erased everything and just had a simple "echo test > ~/test" and that did not work either. Has anyone else run into this? Even without the wake lock it should run one line right? If I manually run sshd the daemon works fine and does not seem to exit even without the wake-lock.

The device is a OnePlus 3 running OOS 5.0 (Android 8.0.0).

koalaeagle avatar Jan 01 '18 15:01 koalaeagle

same issue, pixel xl

sureshmnv avatar Jan 14 '18 23:01 sureshmnv

same issue, Huawei p20 pro with Android 8. It can start sshd but not node-red.

silversquasher avatar May 02 '18 07:05 silversquasher

@koalaeagle @sdrausty @silversquasher Did you disable the battery optimizations for Termux and Termux:Boot. Which one is/ are both required? (to inform other users about that/ show a permission request to disable the optimizations if possible)

ghost avatar Jun 10 '18 14:06 ghost

Same here on Samsung A5 (2017) with LineageOS 16.0 20200309-microG-a5y17lte. Never worked

nikonakoneko avatar Mar 14 '20 11:03 nikonakoneko

It's not working for me also Redmi Note 7 Pro

Hax4us avatar Jul 02 '20 08:07 Hax4us

Did anyone find a solution? I have the same problem with a Honor 9 lite

StevenSalazarM avatar Aug 05 '20 23:08 StevenSalazarM

Same here on Lava Iris

phpsyscoder avatar Sep 13 '20 21:09 phpsyscoder

Solution add -D falg to sshd works great for me - Android 8.1 on LG/Nexus 5.x.

Here is complete check list.

  1. Disable Battery Optiomization for Termux and Termux.Boot.

Settings -> Apps & Notifications -> Adavanced -> Special app access -> Battery optiomization -> Not Optimized Should be listed

  • Termux
  • Termux.Boot If not, set "Do not optimize" for them. Other phones: may need to repeat this step with their policy/battery/security manager.
  1. Check permissions on startup script , you should have rwx flags everywhere. (nexus:~)$ ls -ld ~/.termux ~/.termux/boot ~/.termux/boot/start.sh drwx------ 3 u0_a108 u0_a108 4096 Sep 19 22:19 /data/data/com.termux/files/home/.termux drwx------ 2 u0_a108 u0_a108 4096 Sep 19 23:08 /data/data/com.termux/files/home/.termux/boot -rwx------ 1 u0_a108 u0_a108 222 Sep 20 13:54 /data/data/com.termux/files/home/.termux/boot/start.sh (nexus:~)$ cat /data/data/com.termux/files/home/.termux/boot/start.sh

  2. Add -D to sshd (last line) #!/data/data/com.termux/files/usr/bin/sh /data/data/com.termux/files/usr/bin/sshd -D

  3. Run TermuxBoot app once, It needs to register boot receiver.

  4. Reboot phone. It should start sshd after few minutes.

sergey1369 avatar Sep 20 '20 12:09 sergey1369

@ghost @sergey1369 Thanks. Disabling battery optimization for Termux:Boot solved problem for auto start of it on Xaiomi Redmi 4A with Android 7. For Redmi 7A with Android 10 Termux:Boot works normally without disabling battery optimization for it.

AntonSamokat avatar Nov 23 '22 18:11 AntonSamokat

Its not working for my Samsung Note 8

uniquecollins avatar Jul 31 '23 06:07 uniquecollins