termux / termux-boot

Termux add-on app allowing programs to be run at boot.
https://f-droid.org/en/packages/com.termux.boot
933 stars 219 forks source link

termux-chroot on Chromebook #8

Closed betson closed 6 years ago

betson commented 6 years ago

I've tried following the stated directions, but I can't get my boot scripts to run. This is on a Chromebook (Dell Chromebook 13 7310) running Android 7.1.1. I've installed and run the Termux:Boot app.

For testing purposes, I've tried running chmod 755 on the file, adding a #! declaration at the top, adding termux-wake-lock as the first statement, and changing the executed statement to echo 'hello'.

$ ls -l ~/.termux/boot
total 8
-rwxr-xr-x 1 u0_a52 u0_a52 13 Oct 12 18:52 start
$ cat ~/.termux/boot/start
termux-chroot
$

I'm not sure what I need to do to get the script to run. Based on the note on a prior issue, here is my logcat -s termux:*:

--------- beginning of main
--------- beginning of system
10-12 18:07:33.375  3265  3265 W termux  : Failed sending SIGKILL: kill failed: ESRCH (No such process)
10-12 18:33:53.043  3265  3265 W termux  : Failed sending SIGKILL: kill failed: ESRCH (No such process)
10-12 18:42:15.338  3265  3265 W termux  : Failed sending SIGKILL: kill failed: ESRCH (No such process)
--------- beginning of crash

I think those errors may be from exiting Termux via the Chrombook notification tray instead of the exit command. I am testing whether the script ran by checking ls /home (or if the terminal says 'hello' on boot).

aitva commented 6 years ago

@betson I am also running Termux on a Chromebook and I have no problem with chroot.

My boot script is located at .termux/boot/start-sshd and contains:

termux-wake-lock
termux-chroot sshd

The ssh server is started in a chroot environnement and everything works fine.

betson commented 6 years ago

I'm not sure how to proceed or do any more debugging. I've tried keeping Termux:Boot open during my Termux session and changing the name of the script in case start was somehow a reserved word. Is there something I can do to test Termux:Boot in some way?

SDRausty commented 6 years ago

Hopefully this page https://wiki.termux.com/wiki/Termux:Boot will be of some use with this issue.

timnolte commented 6 years ago

I'm not quite sure why, but I ended up combining everything I wanted started at boot into 1 start script...when I had 3 it seemed that only the final script (executed alphanumerically) would end up having it's services running. Here's what I ended up with to get my SSH server/MariaDB/Nginx all running at boot.

termux-wake-lock
sshd &
termux-chroot mysql.server start &
nginx &
betson commented 6 years ago

I'm going to close this. I'm not sure how to debug, and this was really to just save me from typing a single command on start. So I'll just do that instead.