Draft: manager: experimental implementation of custom systemd replacement
Code in this merge request is mainly for experimental purposes around #739 (closed) . I am not sure this is the way forward and I wanted to get more data about this direction of development, so I just tried to implement something.
What's the goal of this attempt?
Replace systemd with custom process manager written in pure C with these features:
-
support sd_notify
from libsystemd -
can be restarted without downtime to update code -
model process state with a simple state machine -
allow manager to start new kresd
andgc
instances with dynamic arguments -
report status about running processes -
automatically start manager when invoked for the first time -
clean termination at the end
Known problems
- manager hangs on
epoll_wait
(yes, Python gets stuck somehow) shortly after start and I have no clue about the reasons - no proper logging
- error handling is done by logging and aborting afterwards
- current idea for dynamic configuration using ENV variables controlled over control socket is really sketchy
What does this experiment tell us?
These are wild guesstimates. Getting to this point took me roughly 2-3 evenings, let's say 10 hours. If we assume Pareto principle works for this, it would take 40 more hours to complete at a reasonable state. Double it for safety... So in 80h, we could have a working solution for #739 (closed)
#739 (closed) give us?
What would this approach to fixing- control over how everything is executed
- solve problem with privileges
- ability to run in Docker and any systemd-less environment
- some critical bugs to smash
- ???
How to try it out?
Make sure you have poetry installed and that manager can run with poe run
. Then, just make run
in manager/
directory should be enough.