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

Allow systemctl run in chroot()ed environment. #28

Merged
merged 1 commit into from
Oct 8, 2019
Merged

Allow systemctl run in chroot()ed environment. #28

merged 1 commit into from
Oct 8, 2019

Conversation

jmencak
Copy link
Contributor

@jmencak jmencak commented Oct 8, 2019

Some code in the tuned daemon relies on running systemctl commands. Export SYSTEMD_IGNORE_CHROOT=1 so that it is visible to the systemctl commands inside the tuned daemon.

See redhat-performance/tuned#197 for detail.

Some code in the tuned daemon relies on running systemctl commands.
Export SYSTEMD_IGNORE_CHROOT=1 so that it is visible to the
systemctl commands inside the tuned daemon.

See redhat-performance/tuned#197
for detail.
@openshift-ci-robot openshift-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 8, 2019
@jmencak
Copy link
Contributor Author

jmencak commented Oct 8, 2019

/cc @yrobla
/assign @sjug

@sjug
Copy link

sjug commented Oct 8, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 8, 2019
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jmencak, sjug

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit b7c76ea into openshift:master Oct 8, 2019
@jmencak jmencak deleted the systemd_ignore_chroot branch October 8, 2019 11:19
@yrobla
Copy link
Contributor

yrobla commented Oct 8, 2019

How this will affect the PR i wrote? I am still seeing issues, exactly the same ones. That is from a fedora container with podman:
[root@cfe26b3cafda /]# export SYSTEMD_IGNORE_CHROOT=1
[root@cfe26b3cafda /]# systemctl is-system-running
offline

@jmencak
Copy link
Contributor Author

jmencak commented Oct 8, 2019

How this will affect the PR i wrote? I am still seeing issues, exactly the same ones. That is from a fedora container with podman:
[root@cfe26b3cafda /]# export SYSTEMD_IGNORE_CHROOT=1
[root@cfe26b3cafda /]# systemctl is-system-running
offline

I'm testing only on OCP:

$ oc get clusterversion
NAME      VERSION                        AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.3.0-0.ci-2019-10-08-042509   True        False         4h46m   Cluster version is 4.3.0-0.ci-2019-10-08-042509
$ oc get pods
NAME                                            READY   STATUS    RESTARTS   AGE
cluster-node-tuning-operator-86f68c45f7-nnrgm   1/1     Running   0          105m
tuned-k4qjs                                     1/1     Running   0          105m
tuned-smm67                                     1/1     Running   0          105m
tuned-tjtw6                                     1/1     Running   0          105m
tuned-ttxpr                                     1/1     Running   0          105m
$ oc rsh tuned-k4qjs 
sh-4.2# SYSTEMD_IGNORE_CHROOT=1 systemctl is-system-running
running

@yrobla
Copy link
Contributor

yrobla commented Oct 8, 2019

There is a difference between executing that call with crictl/podman (shows error), and executing it with oc rsh (works). If i enter into the container with crictl exec , i get:
export SYSTEMD_IGNORE_CHROOT=1
[cluster-node-tuning-operator@cluster-node-tuning-operator-6bcdd8f9fb-w2jkn /]$ systemctl is-system-running
Failed to get D-Bus connection: Operation not permitted

And if i execute it with oc rsh, it works.

@jmencak
Copy link
Contributor Author

jmencak commented Oct 9, 2019

Hmm, still have no reproducer, sorry:

[root@dev-zz5kq-worker-0-mn92q core]# crictl ps|grep tuned
be459ba5aed59       6ac5d763170e8e369c70954091f862b10fcce37681fe9f2689eb5d3fe0114545                                                                     2 hours ago         Running             tuned                        0                   8a128a6b5f290
[root@dev-zz5kq-worker-0-mn92q core]# crictl exec -it be459ba5aed59 /bin/bash
bash-4.2# SYSTEMD_IGNORE_CHROOT=1 systemctl is-system-running
running

Saying that, I tested on OCP 4.2 with RHCOS8 on the node and RHEL7 as the container image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants