Git Product home page Git Product logo

Comments (5)

Grimler91 avatar Grimler91 commented on July 23, 2024 2

If runsv is not running then $PREFIX/etc/profile.d/start-services.sh has not been sourced. Did you open a new shell rather than restarting termux after installing termux-services?

Try source $PREFIX/etc/profile.d/start-services.sh or restart termux and try again.

If it still does not work please give output of pstree.

from termux-services.

dsche-cyber avatar dsche-cyber commented on July 23, 2024

I really restarted termux. I even rebootet multiple times. I tried sourcing, still doesn't work.

pstree output in tmux:

?─┬─?───bash───tmux: client
     └─tmux: server─┬─4*[bash]
                 └─bash───pstree

pstree output:

?─┬─?───bash───pstree
  └─tmux: server───4*[bash]

from termux-services.

Grimler91 avatar Grimler91 commented on July 23, 2024

What's your output of termux-info?

Does source $PREFIX/etc/profile.d/start-services.sh give you an error?

from termux-services.

dsche-cyber avatar dsche-cyber commented on July 23, 2024

termux-info:
Linux localhost 3.4.113 armv71 Android
Device Model: SM-9005

source $PREFIX/etc/profile.d/start-services.sh
gives nothing

Now sv-enable tor gives:
warning: tor: unable to open supervise/ok: file does not exist

Still just tor works.

In $PREFIX/etc/profile.d/start-services.sh

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

In $PREFIX/var/service is a directory, within a run (script), which starts tor (./run)

from termux-services.

Grimler91 avatar Grimler91 commented on July 23, 2024

After looking into this a bit (finally) it seem to happen when something goes wrong when runsv starts. If we delete the supervise folder for a running service then sv status gives this error, but the service continues to run without issues, so it is not quite the same as here.

I can somewhat reliably create the issue for a log service by setting up a service + script, but adding some well-crafted sleep statements in the middle of the script. Running this:

cd $PREFIX/var/service
echo -e "#!/data/data/com.termux/files/usr/bin/bash\necho 1\nsleep 3" > foo/run
chmod u+x foo/run
sleep 2
mkdir foo/log
sleep 1
ln -s $PREFIX/share/termux-services/svlogger $PREFIX/var/service/$sv/log/run

sv status foo then gives run: foo: (pid 28148) 3s; warning: foo/log: unable to open supervise/ok: file does not exist occasionally, so I guess there is some sort of race condition happening.

It can be fixed quite easily by killing the runsv process (check PID with ps aux | grep runsv), it then restarts and creates the supervise folder and everything works. Rebooting the phone also works, but I think that did not work when this situation happened "naturally" after installing with apt? Need to look into it more I guess

from termux-services.

Related Issues (20)

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.