Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ncm-systemd: initial support for systemd unit control #424

Merged
merged 68 commits into from May 5, 2015

Conversation

stdweird
Copy link
Member

Provide inital framework to handle systemd units.

@stdweird
Copy link
Member Author

It's a lot of code, and it can't do much yet (but it's not so trivial as chkconfig 😄 )

Known issues

  • no target handling
  • too much verbose logging
  • not used to run anything 😄
  • no ncm-chkconfig drop in code

Feedback is welcome, no need to review the cmddata modules 😄

@stdweird
Copy link
Member Author

@ned21 don't review per commit. There is some major rework done at the end, i'm open to suggestion how to rewrite the git history.

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/NCM_Components-pull_requests/528/
Test PASSed.

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/NCM_Components-pull_requests/529/
Test PASSed.

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/NCM_Components-pull_requests/531/
Test PASSed.

@jrha jrha added this to the 15.4 milestone Feb 26, 2015
@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/NCM_Components-pull_requests/532/
Test PASSed.

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/NCM_Components-pull_requests/546/
Test PASSed.

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/NCM_Components-pull_requests/547/
Test PASSed.

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/NCM_Components-pull_requests/552/
Test PASSed.

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/NCM_Components-pull_requests/553/
Test PASSed.

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/NCM_Components-pull_requests/554/
Test PASSed.

sshd => 1,
);

Readonly my $BASE => "/software/components/systemd";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use $self->prefix instead as this then allows module "aliasing"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ned21 what do you mean with aliasing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, it makes things complicated on my end as Systemd::Service is not a component. i'll have to think about this.

the current usage i have in mind is to use unmodified ncm-chkconfig profiles under EL7 by including the following template in EL7:
https://github.com/stdweird/configuration-modules-core/blob/systemd/ncm-systemd/src/main/pan/components/systemd/legacy/chkconfig.pan

it sets an alias on ncm-chkconfig for a partial ncm-systemd, namely the part of ncm-systemd that deals with services. (ncm-systemd will also be able to do e.g. unit configuration, the equivalent of current ncm-sysconfig).

@jouvin jouvin modified the milestones: 15.2, 15.4 Mar 14, 2015
@jouvin
Copy link
Contributor

jouvin commented Mar 14, 2015

Could we merge this one (with or without @ned21 suggested change) to allow give it some early exposure for those starting to look at EL7. I think this is in line with Grenoble discussion. As it is still not use in any part of the template library, it is harmless if the component is not yet rock solid. We may add a disclaimer in the doc that this is an early/beta version and that many things are subject to change in the next release, including the schema... What do you think?

@stdweird
Copy link
Member Author

@jouvin i'd like things reviewed before merged in. i also found that the possible_missing work is not sufficient, so expect a few more commits. people who want to work with ncm-systemd can build there own package (15.4 is only 1.5 months away btw).

@jouvin
Copy link
Contributor

jouvin commented Mar 15, 2015

Ok, as you prefer. As I said, personnally I don't mind putting a beta version of a new component (not an existing one!) in a release if we manage to put a disclaimer somewhere...

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/NCM_Components-pull_requests/561/
Test PASSed.

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/NCM_Components-pull_requests/562/
Test PASSed.

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/NCM_Components-pull_requests/563/
Test PASSed.

@stdweird stdweird changed the title ncm-systemd: initial supprt for systemd unit control ncm-systemd: initial support for systemd unit control Mar 16, 2015
@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/NCM_Components-pull_requests/564/
Test PASSed.

@jrha jrha modified the milestones: 15.4, 15.2 Mar 17, 2015
@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/NCM_Components-pull_requests/576/
Test PASSed.

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/NCM_Components-pull_requests/594/
Test PASSed.

… but has an active unit that it is triggeredby, is considered active.
@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/NCM_Components-pull_requests/596/
Test PASSed.

@stdweird
Copy link
Member Author

current state: we run this in production as pure replacement for ncm-chkconfig using nothing more then

include 'components/systemd/legacy/chkconfig';

in the
config/core/base for centos7 os

and a modification to the structure_component type in the the core quattor/schema

    "ncm-module"        ? string with match(SELF, '^([a-zA-Z_]\w*(?:::[a-zA-Z_]\w*)*)$')

everything else is unmodified wrt templates and it seems to work quite ok.

@stdweird
Copy link
Member Author

see quattor/template-library-core#63 for the schema change

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/NCM_Components-pull_requests/597/
Test PASSed.

@jrha
Copy link
Member

jrha commented Apr 17, 2015

I really want this in 15.4, I'll try and find some time to sit down and go through the code, but the more reviewers the better!

# they do show up in list-units --all
# even when only chkconfig --add is used
# systemctl mask removes it from the output of chkconfig --list
# systemctl umask restores it to last known state
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

umask => unmask

@ned21
Copy link
Contributor

ned21 commented Apr 19, 2015

The code looks OK although I am not sure it will give very useful output in NoAction mode without the "list" commands to provide data to work with. I don't know anything about systemd to conclude whether this is the "right" way to implement this but I guess the schema and use of the component was reviewed at the workshop?

@stdweird
Copy link
Member Author

@ned21
wrt NoAction, without any list data, it's pretty much useless.
the component was presented at the workshop, the schema briefly reviewed. main target use for now is to use the configuration from existing /software/components/chkconfig. i guess when people will actually use it, we'll see how it goes.
what do you want to know about systemd wrt the "right" way? main i can provide some further info.

…rmless (i.e. that only query for iniformation, not for making changes)
@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/NCM_Components-pull_requests/663/
Test PASSed.

@jouvin
Copy link
Contributor

jouvin commented Apr 30, 2015

I'm trying to use ncm-systemdbut when I include the chkconfig compatibility, I get the following error:

     [panc] validation error [/scratch/jouvin/quattor/cdb/cfg/clusters/lal/service-machines-test/profiles/tracsrv2.lal.in2p3.fr.pan]
     [panc] record definition contains unexpected field(s): ncm-module 
     [panc] element path: '/software/components/chkconfig'
     [panc] type: 'component_chkconfig_type' [/scratch/jouvin/quattor/cdb/cfg/quattor/15.4.0-dev/components/chkconfig/schema.pan:67.33-71.1]
     [panc] path '/software/components/chkconfig' bound to type component_chkconfig_type in [/scratch/jouvin/quattor/cdb/cfg/quattor/15.4.0-dev/components/chkconfig/schema.pan:73.41-73.64]

Do I need an updated schema?

@stdweird
Copy link
Member Author

@jouvin
Copy link
Contributor

jouvin commented Apr 30, 2015

Works like a charm :) Thanks for this very useful contribution. I'll add the suggested include as part of the base EL7 config in the template library: this will make the transition very easy.

As far as I'm concerned, I think it is ready for merging.

@jrha
Copy link
Member

jrha commented Apr 30, 2015

Agreed.

@jouvin
Copy link
Contributor

jouvin commented May 5, 2015

Were @ned21's comments about keepstataddressed (#424 (diff))? If yes, I am ready to merge it. We'll open issues when they arise...

@stdweird
Copy link
Member Author

stdweird commented May 5, 2015

@jouvin yes, the second last commit should do that

jouvin added a commit that referenced this pull request May 5, 2015
ncm-systemd: initial support for systemd unit control
@jouvin jouvin merged commit 25fcd4a into quattor:master May 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants