GithubHelp home page GithubHelp logo

Comments (14)

Gerschtli avatar Gerschtli commented on August 26, 2024 1

That sounds like some android stuff.. If you have more knowledge in this regard, feel free to play around with https://github.com/t184256/nix-on-droid-app. Android knowledge is generally lacking in this project unfortunately.

from nix-on-droid.

t184256 avatar t184256 commented on August 26, 2024

Service management is complicated, mostly because it's android development territory, where I'm quite inept.

My ideal service management story would be having a real init (systemd would be sweet, but maybe something like runit might work), with a lifetime equal to the lifetime of the notification, so that you can acquire wakelock, end all sessions and still keep it running.

Are you sure that killing the app doesn't reap all its processes? That sounds real weird to me, actually, I would expect that it does.

from nix-on-droid.

Gerschtli avatar Gerschtli commented on August 26, 2024

A real init system would be nice but maybe an overkill. But I had not that much contact with setting up init systems and what kind of init systems exist already. A quite mimimal one for a primitive service management with transitive dependencies should be sufficient.

Yes I am sure. Example: Run ssh-agent, you can see the process via htop for example. If you exit the app via the notification and start the app again, you can see ssh-agent process is still running. When instead you use force quit in android settings, the process will be killed.

from nix-on-droid.

Gerschtli avatar Gerschtli commented on August 26, 2024

Maybe the app only kills the login process that it started but because ssh-agent is detached completely and no member of the login process group (which forces the app to kill it explicitly), it remains running.

from nix-on-droid.

t184256 avatar t184256 commented on August 26, 2024

Aha. Then we are after a process supervisor

from nix-on-droid.

t184256 avatar t184256 commented on August 26, 2024

(fat fingers) Then we are after a process supervisor (supervisord? daemontools? something else?), spawning it, demonized, from the login script, ensuring that we have one and, maybe, hooking the 'exit' button to stop it.

from nix-on-droid.

t184256 avatar t184256 commented on August 26, 2024

Might be relevant: http://sandervanderburg.blogspot.com/2020/02/a-declarative-process-manager-agnostic.html

from nix-on-droid.

Gerschtli avatar Gerschtli commented on August 26, 2024

Oh forgot about this thread here..

I think we should consider using a init system, that provides us with functionality like service management, but is still as minimal as it can be. I don't know many init systems out there, so can you recommend any?

Would be a pretty neat feature for our small project :)

from nix-on-droid.

t184256 avatar t184256 commented on August 26, 2024

Last time I've researched that, a systemd-versed friend told me that systemd is out of question (that the whole nix-on-droid is beyond crazy). For the remaining ones, I recall supervisord was the most promising one, but I don't remember the details now.

from nix-on-droid.

Gerschtli avatar Gerschtli commented on August 26, 2024

Alright, I will have a look into supervisord as a starting point.

from nix-on-droid.

MatthewCroughan avatar MatthewCroughan commented on August 26, 2024

@t184256 supervisord works flawlessly for managing multiple processes inside of Docker containers for example, here is an example config in a project:

I think it'd be a great fit for nix-on-droid. My use case is that I want to use nix-on-droid to replicate the work I've done with Docker to run on Android devices by acquiring wakelock and having these processes run under supervisord. It would be fantastic if we could spawn these processes declaratively in the nix configuration on Android by this method.

It's worth noting that Termux can already spawn processes at boot via this addon

from nix-on-droid.

tobiasBora avatar tobiasBora commented on August 26, 2024

I would also love to see services in nix-on-droid. My use case would be to create a cron entry to start a script on a regular basis (it would be even cooler if it were compatible with systemd syntax, in order to re-use all the code made for systemd)

from nix-on-droid.

Gerschtli avatar Gerschtli commented on August 26, 2024

The current approach would use supervisord, see #203, but it is still WIP

from nix-on-droid.

tobiasBora avatar tobiasBora commented on August 26, 2024

Yeah, I saw that, thanks for the link. But I guess this would not start nix-on-droid automatically at startup, right? We should maybe add some options to automatically start nix-on-droid when the phone reboots, as I would not want my cron tasks to stop after a reboot.

from nix-on-droid.

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.