> If you're willing to make a PR that switches to your improved version with systemd, it would benefit everyone using the stock masterfiles, especially if it's backwards compatible.
Unfortunately its not backwards compatible. Its not a "library" policy. We actively execute it. It has to be one of the first policies we execute, since the classes it raises after the initial systemd state probe are used throughout policy execution. So, a user cant simply do services: "blah" service_policy => "start" Without executing our "discovery policy" first. The discovery policy executes some python, which probes the entire systemd state and populates variables in policy via usemodule. http://pastebin.com/Zb1CYHUk I did include the source code here: https://groups.google.com/d/msg/help-cfengine/8ZroF8EvJLQ/m_KF2i5lCQAJ I can upload it somewhere in git, but its an architectural change to service management. Cfengine probes the state of systemd via a policy actively early in execution, and thats it. All policies used that cached information. Right now, standard_services is used more of a passive "library" than an actively executed policy. Using our infrastructure is a change in service management architecture. On Fri, Jun 24, 2016 at 1:22 PM, Ted Zlatanov <[email protected]> wrote: > On Thu, 23 Jun 2016 21:07:53 -0400 Mike Svoboda < > [email protected]> wrote: > > MS> I spent quite a bit of time refactoring standard_services to work > better > MS> with systemd. > MS> https://groups.google.com/forum/#!topic/help-cfengine/2Vd7op97Tz4 > > MS> We actually spend 95% + of our CPU time in policy in > standard_services. I > MS> haven't had time to trace down where we're spinning at, but I'm > guessing > MS> its probably the regex parsing with all of the process promises. > > MS> With the implementation above, we probe systemd's state once, raise > MS> namespace classes, and then use those classes for the rest of > execution. > MS> Basically, we only enter the policy once and use the cached raised > classes > MS> from the first pass, instead of entering the policy a million times to > MS> re-evaluate process state. > > MS> Its orders of magnitude more efficient. > > If you're willing to make a PR that switches to your improved version > with systemd, it would benefit everyone using the stock masterfiles, > especially if it's backwards compatible. > > Ted > > -- > You received this message because you are subscribed to the Google Groups > "dev-cfengine" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/dev-cfengine/87eg7my01u.fsf%40lifelogs.com > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "dev-cfengine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/dev-cfengine/CAPPY8H2E%3DBovAgUm-qF6GxLmn0r22jvAtvWBQO4NtgRePHgVRQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
