termux/termux-boot

~/.termux/boot/ 中的文件没有被运行

laisc7301 opened this issue · 2 comments

Problem description
我在 ~/.termux/boot/ 目录下放了一个 "test" 文件并在文件中写入:

pure-ftpd -B -E -l puredb:$PREFIX/etc/pureftpd.pdb -S 0.0.0.0,3721

echo "It run!"

我重启了手机,进入了Termux,但是这段脚本并没有运行。

I reboot the phone and enter the Termux, but this script is not run.

Steps to reproduce

Expected behavior

Additional information

  • Termux application version: 0.118.0 (118)
  • Termux:Boot application version: 0.7 (7)
  • Android OS version: 10
  • Device model: KOZ-AL00

I'd suggest you to do few things:

  • Add shebang: #!/data/data/com.termux/files/usr/bin/sh.
  • chmod +x your script in ~/.termux/boot/ directory.
  • Run termux-wake-lock before executing pure-ftpd.
  • Change echo "It run!" to echo "It run!" > /data/data/com.termux/files/home/termux-boot.txt. Reboot your device and check whether file termux-boot.txt appeared in your home directory.

Note that you need to open Termux:Boot application at least once by clicking on its launcher icon. https://wiki.termux.com/wiki/Termux:Boot

pu-007 commented

I solved the problem by rebooting the phone.
And I started Termux:Boot at first, after that I launched Termux.