Skip to content
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:Boot not working on Android Oreo #38

Open
koalaeagle opened this issue Jan 1, 2018 · 10 comments
Open

Termux:Boot not working on Android Oreo #38

koalaeagle opened this issue Jan 1, 2018 · 10 comments

Comments

@koalaeagle
Copy link

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).

@sureshmnv
Copy link

same issue, pixel xl

@silversquasher
Copy link

silversquasher commented May 2, 2018

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

@ghost
Copy link

ghost commented Jun 10, 2018

@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 ghost transferred this issue from termux/termux-app Sep 6, 2019
@nikonakoneko
Copy link

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

@Hax4us
Copy link
Member

Hax4us commented Jul 2, 2020

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

@StevenSalazarM
Copy link

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

@phpsyscoder
Copy link

Same here on Lava Iris

@sergey1369
Copy link

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.

@AntonSamokat
Copy link

@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.

@termux termux deleted a comment from N-mh07 Feb 28, 2023
@uniquecollins
Copy link

Its not working for my Samsung Note 8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

11 participants