Code Monkey home page Code Monkey logo

Comments (4)

gdraheim avatar gdraheim commented on September 25, 2024 1

I have cut out the remaining features to "exit init-process when the required services have died" #27 ... while I am closing this ticket for the current milestone. In most situation it will do what is expected.

Note that I was rethinking it also as may be one could use /usr/bin/systemctl as the main process before running an actual service. In reality I found that simulations of an operating system in a container had the "cron" and possibly "sshd" running. So the list of processes is not empty.

from docker-systemctl-replacement.

gdraheim avatar gdraheim commented on September 25, 2024

Note however that the kubernetes restart-policy includes livenessProbe / readinessProbe actions that do not rely on the existance of a PID-1

https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy

from docker-systemctl-replacement.

antoinetran avatar antoinetran commented on September 25, 2024

I can add that

  1. the timeout is useful to debug (otherwise, a restart policy set to always will loop and one cannot enter in the container to do some debug).
  2. when there is an error, init should return not 0.

from docker-systemctl-replacement.

gdraheim avatar gdraheim commented on September 25, 2024

Instead of checking for dead services I have impemented atleast the most basic condition for an exit - if the systemctl.py init process finds itself to be alone in a container then it will exit. In the case that all the "systemctl halt" services have correctly stopped, thereby killing all its children, then the systemctl.py will stop as well.

That's also okay for a debugging POV as there is nothing left to attach to.

The only missing point is the exit status of PID 1. What shall it return? A forking service will not transmit an exit code. Neither oneshot - basically it does only make sense when there is a type=simple service and one would ask systemctl.py to mimic the behaviour as if someone has been extracting the ExecStart statement to make a docker-entrypoint.sh with a final exec-$cmd. Or is there more to it?

from docker-systemctl-replacement.

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.