Git Product home page Git Product logo

termux-boot's Introduction

Termux:Boot

Build status Join the chat at https://gitter.im/termux/termux

A Termux add-on app to run programs at boot.

When developing (or packaging), note that this app needs to be signed with the same key as the main Termux app in order to have the permission to execute scripts.

Installation

Termux:Boot application can be obtained from F-Droid.

Additionally we provide per-commit debug builds for those who want to try out the latest features or test their pull request. This build can be obtained from one of the workflow runs listed on Github Actions page.

Signature keys of all offered builds are different. Before you switch the installation source, you will have to uninstall the Termux application and all currently installed plugins. Check https://github.com/termux/termux-app#Installation for more info.

How to use

  1. Install the Termux:Boot app.
  2. Start the Termux:Boot app once by clicking on its launcher icon. This allows the app to be run at boot.
  3. Create the ~/.termux/boot/ directory.
  4. Put scripts you want to execute inside the ~/.termux/boot/ directory. If there are multiple files, they will be executed in a sorted order.
  5. Note that you may want to run termux-wake-lock as first thing if you want to ensure that the device is prevented from sleeping.

Examples

To start an sshd server and prevent the device from sleeping at boot, create the following file at ~/.termux/boot/start-sshd:

#!/data/data/com.termux/files/usr/bin/sh
termux-wake-lock
sshd

To start termux-services, which in turn starts enabled services, you can put the following in ~/.termux/boot/start-services:

#!/data/data/com.termux/files/usr/bin/sh
termux-wake-lock
source /data/data/com.termux/files/usr/etc/profile.d/start-services.sh

License

Released under the GPLv3 license.

termux-boot's People

Contributors

agnostic-apollo avatar dependabot[bot] avatar fornwall avatar grimler91 avatar landfillbaby avatar pacien avatar tacothedank avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

termux-boot's Issues

Termux:Boot doesn't work on andriod v9.0.0.

Problem description
I've made a script under ~/.termux/boot/ and from the example tried:

#!/data/data/com.termux/files/usr/bin/sh
termux-wake-lock
a

I've even tried bash at the end of the shebang.

Steps to reproduce
a is an alias command in ~/.bashrc with following contents:

alias a="cd ~/storage/shared/ariel-bot/ && forever index.js"

I've tried calling the script without the a alias and still doesn't work.

Expected behavior
The forever app should be running a nodejs script in the background. It works fine with the alias but doesn't work when device boots.

Additional information

termux-info
Updatable packages:
All packages up to date
Subscribed repositories:
https://dl.bintray.com/grimler/science-packages-24 science/stable
https://dl.bintray.com/grimler/game-packages-24 games/stable
https://dl.bintray.com/termux/termux-packages-24 stable/main
System information:
Linux localhost 3.18.91-16437721 #1 SMP PREEMPT Wed Jul 24 15:53:54 KST 2019 armv8l Android
Termux-packages arch:
arm
Android version:
9
Device manufacturer:
samsung
Device model:
SM-J330FN
$

Node-Red Not Found

Hi,

I installed both termux-app and termux-boot. In termux-app I followed the node-red official guide and it was possible from terminal to find and to run the program. Inserting the command inside a file under the directory ~/.termux/boot and debugging the call, it was possible to see that the file is called but on the node-red line the log write:

node-red: not found
screenshot_20180702-122515

Not executing script at boot

There's a good chance I've missed something obvious, but Termux:Boot isn't working for me.

I've installed Termux:Boot on my Nexus 6 running Android 7.0, and I've launched the app.

$ ls -l ~/.termux/boot/
total 4
-rwxr-xr-x 1 u0_a98 u0_a98 141 Aug  6 20:51 start
$ cat ~/.termux/boot/start
#!/data/data/com.termux/files/usr/bin/sh

crond
sshd
echo "$(date +'%a %F %T %Z') /data/data/com.termux/files/home/boot/start" >> $HOME/.log
$

(The documentation doesn't say the script needs to be executable or have a #! line, but I figured it wouldn't hurt.)

The script doesn't execute when I reboot the phone. sshd isn't running, and nothing is written to $HOME/.log.

sshd example not actually running at boot

Steps to reproduce

  1. install termux from f-droid
  2. launch termux and install openssh via pkg install openssh
  3. set passwd and start the ssh daemon via sshd
  4. confirm that another computer on the LAN can ssh -p 8022 IP
  5. while connected via ssh, run:
mkdir -p .termux/boot 
echo -e '#!/data/data/com.termux/files/usr/bin/sh \n termux-wake-lock \n sshd' > .termux/boot/start-sshd
chmod +x .termux/boot/start-sshd
  1. exit ssh, and go back to device
  2. install termux:boot from f-droid
  3. launch termux:boot
  4. reboot device
  5. observe that even after several minutes, the device is still not accessible via ssh.
  6. lauch termux and confirm that running .termux/boot/start-sshd renders the device accessible via ssh

Expected behavior
Device accessible via SSH at boot

Additional information

  • Termux application version: 0.104
  • Termux:Boot application version: 0.7
  • Android OS version: 9
  • Device model: VANKYO S30

Android x86 RC2 support?

Tried to install Termux Boot from FDroid on Android x86 8.1 RC2 (64 bit). Got an "Unexpected error" during installation. Should I provide debug logs or, perhaps just figure out how to setup autorun manually?

Termux Plugin Execution Command Error

Problem description

I have created the ~/.termux/boot directory and placed my .sh file in there with chmod o+x,g+x,u+x script.sh to ensure there is no lack of permissions.

I have opened the Termux:Boot application multiple times at this point.

Steps to reproduce

cd ~
mkdir .termux/boot
# write some working sh file here
cp ./someworkingfile.sh ./.termux/boot/script.sh
chmod o+x,g+x,u+x ./.termux/boot/script.sh

At this point, I get a screen with following information:

User action: Plugin execution command
Sender: TermuxService

Execution Intent Command
Previous State: Executing
Current State: Failed
Executable: /data/data/com.termux/files/home/.termux/boot/script.sh
Arguments: -
Working Directory: /data/data/com.termux/files/home
inBackground: True
isFailsafe: False
Session Action: -
isPluginExecutionCommand: True

Result PendingIntent Creator:

(all three fields have no value)

Error Code: 2
Error Message
Failed to execute "(1000) Execution Intent Command" termux task command

First line of stack trace:
java.io.IOException: Cannot run program "/data/data/com.termux/files/home/.termux/boot/script.sh" (in directory "/data/data/com.termux/files/home"): error=2, No such file or directory

But the file is there? Did I miss a step? Am I missing a vital package or setup?

Expected behavior

For the script to run at boot without error

When manually ran (sh script.sh) this script works perfectly.

Additional information

  • Termux application version: 0.117
  • Android OS version: 11 - ArrowOS, but issue also occurs on the Stock rom.
  • Device model: Motorla Motorola Potter, Moto G5 Plux, (XT1685)

Termux

Problem description
A clear and concise description of what the problem with termux-boot is. You may post screenshots in addition to description.

Steps to reproduce
What does your termux-boot script contain?
Please post the full script here.

Expected behavior
A clear and concise description of what you expected to happen.

Additional information
Post output of command termux-info.
If you are rooted or have access to adb then capture a logcat with logcat -d "*:W", from a adb or root shell.

Unable to install on Android TV Oreo

I was able to install Termux from Google Play onto my Shield TV and it works great so far, but when I try to purchase Termux:Boot the Play Store site says it's not compatible with my device.

Guess I can uninstall and start again with the F-Droid version but I'd also like to support the developer.

termux-boot scripts do not execute on termux-boot version 0.5

I have added a shell script in "/data/data/com.termux/files/home/.termux/boot" called "start-sshd" with the correct interpreter and +x permissions, but the script is not executed at startup, nor is any error reported in the logs.

For debugging I took out everything in the script and just left in an output to file statement like this:

termux-wake-lock
echo "fooo " >> $HOME/a1.log

But there is no file "a1.log" generated in the home directory. When I inspect the logs with logcat -s termux:*. the only entries I see are:

--------- beginning of system
--------- beginning of main

The termux-boot process is started on the phone(As listed in Phone settings>Apps), how can I get more information on why it is failing to execute the script. Here is information about my phone from termux-info:

Updatable packages:
dpkg/stable 1.19.7 arm [upgradable from: 1.19.6]
gpgv/stable 2.2.16 arm [upgradable from: 2.2.15-3]
libcurl/stable 7.65.1 arm [upgradable from: 7.65.0]
libiconv/stable 1.16-1 arm [upgradable from: 1.16]
openssl/stable 1.1.1c arm [upgradable from: 1.1.1b-3]
Subscribed repositories:
https://dl.bintray.com/grimler/science-packages-24 science/stable
https://dl.bintray.com/grimler/game-packages-24 games/stable
https://dl.bintray.com/termux/termux-packages-24 stable/main
System information:
Linux localhost 3.18.35 #1 SMP PREEMPT Mon Nov 20 18:22:56 CST 2017 armv7l Android
Termux-packages arch:
arm
Android version:
7.0
Device manufacturer:
LAVA
Device model:
Z60

Is the WAKE_LOCK permission needed?

Because of it com.termux.boot creates the wake lock which AFAIK blocks a device from sleeping. This is how it looks like:

$ adb shell dumpsys power | grep -A 1 'Wake Locks'
Wake Locks: size=1
  PARTIAL_WAKE_LOCK              '*job*/com.termux.boot/.BootJobService' (uid=1000, pid=883, ws=WorkSource{10091})

Is it really needed, if a person already can control a wake lock using termux-wake-{lock,unlock}?

Termux:Boot not working on Android Oreo

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

Processes are duplicating

I'm getting duplicate processes popping up.

My boot starts a php server for codiad ide:

~/.termux/boot/boot.sh:

#!/data/data/com.termux/files/usr/bin/env bash
/data/data/com.termux/files/home/codiad-run.sh > /dev/null 2>&1 & disown

It runs this simple php server loop:

~/.codiad-run.sh:

#!/data/data/com.termux/files/usr/bin/env bash
cd /data/data/com.termux/files/home/codiad
while true ; do php -S 127.0.0.1:8080 -t /data/data/com.termux/files/home/codiad ; pkill php; done > /dev/null

The boot script is the only place where I'm invoking codiad-run.sh. Everything runs ok for several minutes after booting, until Codiad dies, and when I check, there are 4 processes runing codiad-run.sh.

I've tried starting it with nohup instread of disown, and I also tried leaving the console connected, but same result.

I'm not sure if this is related; when I start apache2 instead, I see it is also getting duplicated, with multiple copies of /data/data/com.termux/files/usr/bin/httpd -k start running.
Apache still works, I don't know if it's expecting this behavior or not.

sshd not started at boot

I create file in ~/.termux/boot/start-sshd with content:

termux-wake-lock
sshd

but when reboot the device, sshd is not running.

How can I debug this problem?

Delays in termux:boot script execution

Termux v0.99 with termux:boot etc
Linux localhost 4.9.113 #1 SMP PREEMPT Mon Aug 17 19:34:10 CST 2020 armv7l Android
Droidlogic X96Max_Plus2 S905X3 4G+64G
Android 9.0

Issue: delays in the execution of boot scripts - typically a minute or longer. After the delay, all scripts execute normally.
The scripts execute immediately if called via .bashrc or as termux-services, but this introduces other problems. I would prefer to run the scripts at boot only. Have resolved using a ~/../usr/etc/profile/d script to test for first boot then conditionally execute boot scripts, but have not sorted termux:boot.

termux:boot is correctly installed and scripts in correct location.

Similar delays with old release:
Linux localhost 3.14.29 #1 SMP PREEMPT Thu Jan 5 12:02:30 CST 2017 armv8l Android
Amlogic TX8 S905 2G+32G
Android 6.0.1

A bug or a feature?

TIA.

Can not start script with sudo

Problem description
startup script not execute when Andorid restart

Steps to reproduce

  1. Install termux boot app
  2. create startup script in /data/data/com.termux/files/home/.termux/boot
  3. In my ubuntu terminal enter adb shell then check nginx process by ps | grep nginx. Have no any output
    netease-proxy.sh
#!/data/data/com.termux/files/usr/bin/sh
termux-wake-lock
sshd
nohup /data/data/com.termux/files/usr/bin/node /data/data/com.termux/files/home/apps/netease/proxy/app.js -p 5621:5620 -f 59.111.181.60 > /dev/null  2>&1 &
sudo nginx

The 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.conf


user  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;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;
    	server {
    		listen 80;
		server_name music.163.com interface.music.163.com;
	    	location / {
            		proxy_pass http://127.0.0.1:5621;
            		proxy_set_header HOST 'music.163.com';
    		}
	}
	server {
	    listen 443;
	    server_name music.163.com interface.music.163.com;
	    location / {
	            proxy_pass https://127.0.0.1:5620;
        	    proxy_set_header HOST 'music.163.com';
    		}
	}
}

Expected behavior

Nginx,App.js,sshd will start when Android started
Additional information
termux-info

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

Boot scripts not being automatically executed after boot

** Edited after further testing **

Problem description
Scripts in ~/.termux/boot seem not being executed at boot ...
Is there anything i can do to troubleshoot?

Steps to reproduce

  1. Install termux app (from f-droid in my case)
  2. install termux-boot app (from f-droid as well)
  3. Start termux boot app (see the instructions)
  4. Create ~/.termux/boot dir
  5. Create the following script:
$ cat 00_autostart 
#!/data/data/com.termux/files/usr/bin/bash
termux-wake-lock
date > $HOME/date

Expected behavior
Create/update the $HOME/date file after boot

Additional information

  • Termux application version: 0.95. Termux boot is version 0.7
  • Android OS version: 9.0
  • Device model: unbranded chinese tablet.

BOOT_COMPLETED: process is bad

Problem description
com.termux.boot is not starting at system boot. Startup scripts are not executed.

Steps to reproduce
What does your termux-boot script contain?

$ ls -l ~/.termux/boot/
total 16
-rwx------    1 u0_a54   u0_a54          17 Jun 27 00:41 00-wake-lock.sh
-rwx--x--x    1 u0_a54   u0_a54           5 Jun 27 00:41 10-sshd.sh
-rwx--x--x    1 u0_a54   u0_a54          72 Jun 27 01:09 20-ftpd.sh
-rwx--x--x    1 u0_a54   u0_a54          66 Jun 27 01:22 30-httpd.sh
$ 

Please post the full script here.

$ cat ~/.termux/boot/*
termux-wake-lock
sshd
/system/bin/logwrapper tcpsvd -vE 0.0.0.0 10021 ftpd -w $HOME/storage &
/system/bin/logwrapper lighttpd -D -f $PREFIX/etc/lighttpd.conf &
$ 

Expected behavior
Scripts in the ~/.termux/boot/ are started at system boot.

Additional information
Post output of command termux-info.

$ termux-info 
Updatable packages:
openssl/stable 1.1.1c-1 aarch64 [upgradable from: 1.1.1c]
Subscribed repositories:
https://dl.bintray.com/grimler/science-packages-24 science/stable
https://dl.bintray.com/grimler/game-packages-24 games/stable
https://dl.bintray.com/termux/termux-packages-24 stable/main
System information:
Linux localhost 3.10.104 #160 SMP PREEMPT Fri Sep 22 12:59:52 CST 2017 aarch64 Android
Termux-packages arch:
aarch64
Android version:
7.1.2
Device manufacturer:
rockchip
Device model:
RockBox-Basic
$ 

If you are rooted or have access to adb then capture a logcat with logcat -d "*:W", from a adb or root shell.
logcat.txt

Set up boot directory

Hi. On my Android I have $HOME directory pointing to /data which the user doesn't have an access to. Is it possible to tweak the location of ~/.termux/boot directory?

Write a script

Hi im new to this and a bit lost, im trying to get a programm to run on start

i have created the boot folder and know how to copy .sh file into it and have used
logcat -s termux:* and can confirm that the .sh file is booting at startup but the program is not actually starting so im obviously not getting the script right

im trying to start a program called sstvProxy.py

it is located here /sdcard/sstvProxy/sstvProxy.py

what i have put in my .sh file is this

#!/bin/bash
python /sdcard/sstvProxy/sstvProxy.py -hl

but it is not working

can someone please help as im really struggling

termux:boot apk on github

The F-Droid version of Termux:Boot will not install with a version of Termux downloaded from github and the F-Droid is the only available source for the Termux:boot apk. Please compile a release of Termux:boot on github that works with github releases of Termux. It gets a bit frustrating having to start all over again!

Not running

I create a folder
cd /data/data/com.termux/files/home/
mkdir .termux/boot
nano start-sshd

content:
termux-wake-lock
sshd

Restart termux
sshd Not started

I am planning to start UBUNTU
File Directory:
cd /data/data/com.termux/files/home/termux-ubuntu/
start up :
./start-ubuntu.sh

termux:boot fails on android 10

I have two tablets, one running android 8 and the another running android 10. I have installed termux and termux:boot (v 0.7) from f-droid exactly the same on both systems. termux:boot works (runs the boot script) on the android 8 tablet, but fails (does not run the script) on the android 10 tablet.

I know everything is correctly configured because the same configuration works on android 8.

If anyone could look into this, I will gladly provide any details, files, debug output etc... needed.

Someone please help (my project cannot move forward without termux:boot).

Have an option for non-interactive sessions

It would be nice if there would be an option to have a non-interactive session to be spawned, with no terminal so that terminal list isn't cluttered with the boot one ( also no risk of accidentally closing it )

Trojans in Termux-Boot?

Problem description

Steps to reproduce

Expected behavior

Additional information

  • Termux application version: Latest
  • Android OS version: 8.0
  • Device model: Cubot X18Plus

a scan on VirusTotal:

  • CAT-QuickHeal Android.Boogr.A14b6
  • Kaspersky HEUR:Trojan.AndroidOS.Boogr.gsh
  • ZoneAlarm by Check Point HEUR:Trojan.AndroidOS.Boogr.gsh

on Termux-Boot = Termux:Boot_base.apk

and:

Mail Problem:
[email protected]: host mx.zoho.com[136.143.191.44] said: 552 5.1.1
[email protected] Mailbox delivery failure policy error (in reply to RCPT TO command)

Got an error when installing from F-Droid

Error Message:
Error installing Termux:Boot
Failed to install due to an unknown error

image

  • Termux application version:
  • Android OS version: 8.1.0.0
  • Device model: Motorola G5s

Starts as task

I want start node-red. When I reboot my divice I can use node red, but it only starts as task. Is it normal? Can I start it in a session?

Nothing happens with apachectl

I installed Termux-boot app..and followed all steps.. I created a file named start-apache in boot directory with 2 line codes in it

termux-wake-lock
apachectl

but nothing happens..

Problem with Codiad in termux-boot

I'm running android 6 on my zenbook, so I've installed Codiad as my IDE. For convenience, I want it to start in termux-boot, so I don't have to login to termux to start it before using it.

The problem is that breaks the git functionality, such that when I try to push or pull, I get an error:

`fatal: could not read Username for 'https://github.com': No such file or directory'

But when I start the server manually after I log in, it works fine.

I've tried it using apache2, and standalone php, and the results are the same. Apparently, the error is referring to a local config file that it isn't able to locate.

Help with Termux boot

hi
i would like syncthing to start it at startup. I have tried to do it as the documentation said
here
But it doesn't work
Things I've made sure to do:

  • I installed both Termux and Termux:Boot from F-Droid.
  • Click the Termux:Boot launcher to "activate" it.
  • chmod u+x ~/.termux/boot/start-syncthing&chmod u+x $PREFIX/var/service/syncthing/run
  • Added both Termux and Termux:Boot to the "No battery optimizations" list,

i would then create an executable script at $PREFIX/var/service/syncthing/run with the content

#!/data/data/com.termux/files/usr/bin/sh

syncthing -logflags 0 2>&1

Create the ~/.termux/boot/ directory.
Put start-syncthingscripts you want to execute inside the ~/.termux/boot/ directory

#!/data/data/com.termux/files/usr/bin/sh
source /data/data/com.termux/files/usr/etc/profile.d/start-services.sh

start-services.sh

export SVDIR=$PREFIX/var/service
export LOGDIR=$PREFIX/var/log
(service-daemon start >/dev/null 2>&1 & )

System information

  • Termux application version: 0117
  • Termux:boot version: 0.7
  • Android OS version:11
  • Device model:MI9 MIUI12.5

Executing Multiple Scripts at boot

Hi there.

Am completely new to this but will give it my best shot:

Am running termux on my nexus 7 and want it to run both node-red and mosquitto at boot

For this i created 2 files in .termux/boot start-nodered and start-mosquitto

start-nodered has the following in it:

termux-wake-lock
termux-fix-shebang $(which node-red)
node-red

and start-mosquitto has:

termux-wake-lock
mosquitto

The problem I have is that only one of the scripts seems to run when I need them both to start.

If I delete start-nodered then mosquitto starts up perfectly or if I delete start-mosquitto then node-red works fine.

When they are both in there node red starts and not mosquitto.

My guess is that it gets stuck running one and doesn't move on to the other?

If anyone could help me with this it would be much appreciated.

Thanks

Asking for Help from a Customer

Will this actually run my Binary file in my home directory at Boot? Haven't tested it yet cause people are using the Shield for Live TV Viewing....Thanks! Also, How can I get it to run in a detached screen?

termux-wake-lock
termux-chroot
cd ~/
./xteverun -port"8080"

Playstore Link broken / unavailable

Hey,
just wanted to install the addon, but the Playstore Link seems to be broken. In fact, the app isn't available in the Playstore at all. Is there any plan to upload/reupload the app?

Thanks

Side Load Termux Boot fails on Nvidia Sheild

Problem description
Side Load of App ends with message "App not Installed"

Steps to reproduce
Upload Termux Boot from App Backup file (sideLoad) Install.

Expected behavior
Before Shield update it would install

Additional information
$ termux-info
Updatable packages:
All packages up to date
Subscribed repositories:
https://dl.bintray.com/grimler/science-packages-24 science/stable
https://dl.bintray.com/grimler/game-packages-24 games/stable
https://termux.org/packages stable/main
System information:
Linux localhost 4.9.140-tegra-g68283f0ff762 #6 SMP PREEMPT Wed Sep 25 22:55:53 PDT 2019 aarch64 Android
Termux-packages arch:
aarch64
Android version:
9
Device manufacturer:
NVIDIA
Device model:
SHIELD Android TV

ffmpeg issues

Hi folks can someone please help, i have a script that runs a proxy so i get live tv for plex, in order for the channels to play plex needs ffmpeg which i have installed, once i type the python script everything works great

however what i wanted to do was have it auto start, i have used both termux tasker and boot and and using both formats the script is loading the proxy with no issues

The problem is that ffmpeg does not appear to loadusing either of these methods, it should start automatically when terux starts but it is not

any ideas?

Termux Boot doesn't work

I've purchased Termux Boot today but it doesn't seem to work. It claims it launches scripts at device boot, but it doesn't in my case.

I've lauched the app and made the directories .termux and boot as docs advised, added the script, tested it manually, and it works (just launches lighttpd server). But when I restarted my device the server wasn't working!

My script contents:

termux-wake-lock
lighttpd -f /data/data/com.termux/files/home/storage/lighttpd/lighttpd.conf

I must say I have little knowledge in linux in general so maybe I'm missing something.

Please help!

not working on shield 2019 pro

Problem description

can't auto start scripts

Steps to reproduce

follow instructions at https://wiki.termux.com/wiki/Termux:Boot

Expected behavior

scripts run on startup

Additional information

tried both the example script mentioned in the wiki to start sshd
and my one which runs an app in my ubuntu proot. both work as expected if ran manually

  • Termux application version: 0.108
  • Android OS version:9,0
  • Device model: shield TV Pro

termux-chroot on Chromebook

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

boot scripts running TOO frequently!

Hi there, I am curious to know what exactly triggers the running of scripts in ~/.termux/boot? I find that they are run quite often between reboots.

I have a boot script that does only this:

   #!/data/data/com.termux/files/usr/bin/bash
   uptime >> ~/up.txt

The phone booted this morning around 9:29, and it's been up ever since, but here's the contents of up.txt:

 09:29:51 up 0 min,  load average: 13.87, 3.67, 1.24
 09:41:04 up 12 min,  load average: 8.56, 8.22, 5.19
 09:52:04 up 23 min,  load average: 8.91, 8.89, 7.10
 10:04:04 up 35 min,  load average: 8.54, 8.80, 8.04
 10:18:04 up 49 min,  load average: 8.60, 8.59, 8.35
 10:36:04 up  1:07,  load average: 9.00, 8.90, 8.70
 11:02:04 up  1:33,  load average: 9.01, 8.89, 8.79
 11:44:59 up  2:16,  load average: 8.41, 8.65, 8.76
 12:59:56 up  3:31,  load average: 8.90, 8.99, 8.97
 15:17:56 up  5:49,  load average: 8.72, 8.90, 9.05
 19:43:58 up 10:15,  load average: 8.51, 8.81, 8.88

This doesn't seem right but maybe I am misunderstanding something.

I am seeing this on a nexus 5 with lineage os 14.1, but I observe the same behavior on nextbit robin, also running lineage os 14.1.

Thanks for reading

The app does not boot on Android x86

I need an ssh server to start with the box and bought termux-boot, but it does not do what it has promised to do: boot with the box.
I don't want a refund, I want somebody to fix it.
android-x86_64-8.1-r2.iso, the version x86_64

[Feature Request] Allow Termux:Boot to run a Termux "session" instead of an invisible "task"

When Termux:Boot runs a script and an unknown error occurs. There's no way for the user to see what the issue is on the log. From my experience outputting the command log to a file isn't reliable such as node ~/path/to/file/index.js >> log.txt.

The script runs fine when I run it in Termux but the auto script with the exact same command says it's running but it really isn't.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.