Repository navigation
systemd enable/disable - #17
Conversation
|
/cc @sdemos |
|
@ashcrow: GitHub didn't allow me to request PR reviews from the following users: sdemos. Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/hold |
sdemos
left a comment
There was a problem hiding this comment.
other than a small comment on logging, everything here lgtm.
now to just figure out how to convince the bot I mean it...
There was a problem hiding this comment.
I'm not sure if these should be warnings. Once the MCD decides it wants to apply the config, it just lays down all the files, systemd units, etc, exactly how they are defined in the new config without really checking the old one, which means that this warning will get spit out for every enabled unit every time a new config is applied, if that makes sense. same with the other function below.
maybe just do Info?
There was a problem hiding this comment.
I'm cool with it being an Info instead. I'll amend :-)
|
/hold cancel |
|
@sdemos can you try |
|
/lgtm |
|
@sdemos: changing LGTM is restricted to assignees, and only openshift/machine-config-operator repo collaborators may be assigned issues. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
@sdemos try |
|
Come on robot! |
|
/cc @sdemos |
|
@ashcrow: GitHub didn't allow me to request PR reviews from the following users: sdemos. Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
@abhinavdahiya based on the cc attempt I have a bad feeling about lgtm :-/ |
There was a problem hiding this comment.
Stat follows the link target, but an absolute link target does not contain the prefix for the rootfs bind-mount. Depending on the link content, the result that you get here may (or may not) be incorrect.
There was a problem hiding this comment.
In the end it might be most reliable to talk to pid 1 via DBus to do this?
There was a problem hiding this comment.
@cgwalters for this specific case, likely yes. But in general all files/dirs manipulation that may traverse a symlink will be subject to the de-sync above.
There was a problem hiding this comment.
Yeah. See coreos/rpm-ostree#1481 for a related issue in rpm-ostree that we fixed by resolving the symlinks inside a container via bwrap. Since this container is privileged, it should work fine to spawn e.g. a bwrap container targeting the host and run code there if we need to.
It might work best if we created a pattern where just /etc and /var from the host are bind mounted into such a container, but the /usr comes from the container?
There was a problem hiding this comment.
See also https://lwn.net/Articles/723057/ for a not-yet-upstream kernel API that would help here.
|
Please beware that if you do link manipulation and de-referencing over a bind-mount prefix, the targets you get/set will be out-of-sync/wrong compared to the rootfs. |
|
It was pointed out by @lucab that this functionality will be run via a container and, thus, we can't trust the literal paths. See https://github.com/openshift/machine-config-operator/blob/master/docs/MachineConfigDaemon.md#overview. |
|
/hold |
|
One thing I don't quite understand from context is - do we want to affect the current state of the system (booted), or the next state (the next boot)? I find most commonly when I'm doing things like this to a live system I want the equivalent of |
Also a great point. The set of functionality being targeted by this is enabling/disabling a service based on |
in general the daemon is making changes for the next boot. It explicitly doesn't try to more concretely, I think we should just enable the unit and let systemd start it on reboot. |
|
Keeping this on hold until I've worked through the early |
|
Updated based on #26 |
|
/cc @sdemos |
|
/hold cancel |
|
Blocking PR has merged. |
There was a problem hiding this comment.
why does this need to be added to the dockerfile? shouldn't it be enough that it's in the deployment manifest? this should only be run as a pod and not directly anyway. at the very least, it's odd to me to only have this one and none of the other volume mounts.
There was a problem hiding this comment.
It doesn't need to be. I had added it as it felt it clarified that it was a required mount. I'm happy to remove it if you think that would be better :-)
wantsPathSystemd houses the systems path where enable units should be linked. Signed-off-by: Steve Milner <[email protected]>
- enableUnit links a given unit into the enabled path - disableUnit removes a link from the enabled path Signed-off-by: Steve Milner <[email protected]>
|
@sdemos updated |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ashcrow, sdemos The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
bump openshift/library assets
systemd enable/disable
This is pre-work for enabling/disabling units intelligently via incoming config.
enableUnit: Takes aignv2_2types.Unitand attempts to link into the enabled path on the system. If it is already linked the function returns early.disableUnit: Takes aignv2_2types.Unitand attempts to remove the link from the enabled path. If the link does not exist the function returns early.