Replies: 1 comment 1 reply
-
I call these instantiated services where I've thought for a long while about instantiated services ( I also don't understand the relationship to user services. They seem pretty orthogonal to me: the root service set can have normal or instantiated services, and so do services declared by users? But maybe I'm missing something. In short: instances are cool, and relatively easy to code (for you) and understand (for users) as long as you stay with a simple, heavily restricted, dependency model. Beyond that, it's madness. |
Beta Was this translation helpful? Give feedback.
-
okay, for context, currently the user services branch is implemented in way by a very barebones, c-api only dynamic services; so before i scratch all that in favor of another implementation, i wanted to open a discussion
dynamic services is what i'm naming an openrc equivalent to systemd's [email protected] being auto-instantiated to [email protected], when for example, a service tries to depend on foo@nya or an user tries to start foo@nya
--
the implementation currently uses the same heuristics we already do to determine what configurations to load, that is to say, the service name up until the first dot, since starting init.d/net.eth0 loads up conf.d/net as well as conf.d/net.eth0
dynamic services would use the same heuristic to instantiate services, that is to say, when a service does
depend() { need foo.nya }
, andinit.d/foo.nya
does not exist, butinit.d/foo
does exist, then openrc would make a symlink/run/openrc/dynamic/foo.nya -> /etc/init.d/foo
, and use that to resolvefoo.nya
(configurations are loaded 'as-if' the service was on the same folder as the base, so in this case,/etc/conf.d/foo
and/etc/conf.d/foo.nya
would both be loaded)it could be also made so an user running
rc-service foo.nya start
would trigger the same procedure--
there was pushback against this. in a technical matter, this require us to allow service symlinks to live outside the init.d (as they'd be in /run/openrc), however i do believe to have solved any potential issues with this
there was also the question of complexity, that this feature would feel too "automagical"
it's use within openrc --user was brought about for a want of simple and reusable code, since we could reuse the pre-existing service management logic to manage user services, reduce the need for synchronizing state with pam, and so on.
but there is also the argument of simplicity, by supporting that system directly on the pam module, and limit the scope of features wrt how "dynamic" the service management in openrc is. and i do have a good idea of how to implement the pam module and user service without all this "dynamic" stuff
--
so i wanted to ask for a discussion, and in general gather if people are in favor or against such feature before i work on it more, as currently i'm torn on what is the best approach.
and anyway, thanks!
Beta Was this translation helpful? Give feedback.
All reactions