Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1438557

Summary: cannot set RUN_DIRECTORY for system containers
Product: Red Hat Enterprise Linux 7 Reporter: Michael Nguyen <mnguyen>
Component: atomicAssignee: Lokesh Mandvekar <lsm5>
Status: CLOSED ERRATA QA Contact: atomic-bugs <atomic-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: ajia, jzehrarnyg
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-05 10:39:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michael Nguyen 2017-04-03 18:38:42 UTC
Description of problem:
In RHEL Atomic Host 7.3.3 RUN_DIRECTORY could be set on the command line when installing a system container.  In 7.3.4, the RUN_DIRECTORY that is set is no longer applied and set to /run.

Version-Release number of selected component (if applicable):
7.3.4

How reproducible:
Always

Steps to Reproduce:
1. atomic install --system --name=hello-world  --set=RUN_DIRECTORY=/root gscrivano/hello-world
2. cat /var/lib/containers/atomic/hello-world/info
3. Verify that the RUN_DIRECTORY is not set to /root

Actual results:
RUN_DIRECTORY is set to /run

Expected results:
RUN_DIRECTORY is set to /root

Additional info:

See upstream:
https://github.com/projectatomic/atomic/pull/962

PLAY [System Containers - Set RUN_DIRECTORY & STATE_DIRECTORY] *****************

TASK [setup] *******************************************************************
ok: [rhelah]

TASK [Set facts] ***************************************************************
ok: [rhelah] => {
    "ansible_facts": {
        "run_dir": "/root", 
        "state_dir": "/root"
    }, 
    "changed": false
}

TASK [Create container with RUN_DIRECTORY and STATE_DIRECTORY] *****************
changed: [rhelah] => {
    "changed": true, 
    "cmd": [
        "atomic", 
        "install", 
        "--system", 
        "--set=RUN_DIRECTORY=/root", 
        "--set=STATE_DIRECTORY=/root", 
        "gscrivano/hello-world"
    ], 
    "delta": "0:00:01.249007", 
    "end": "2017-04-03 16:37:00.047534", 
    "rc": 0, 
    "start": "2017-04-03 16:36:58.798527", 
    "warnings": []
}

STDOUT:
---
Extracting to /var/lib/containers/atomic/hello-world.0
systemctl daemon-reload
systemctl enable hello-world
---

TASK [Get output of hello-world info file] *************************************
changed: [rhelah] => {
    "changed": true, 
    "cmd": [
        "cat", 
        "/var/lib/containers/atomic/hello-world/info"
    ], 
    "delta": "0:00:00.001918", 
    "end": "2017-04-03 16:37:00.424853", 
    "rc": 0, 
    "start": "2017-04-03 16:37:00.422935", 
    "warnings": []
}

STDOUT:
---
{
    "remote": null, 
    "created": 1491237419, 
    "image": "gscrivano/hello-world", 
    "values": {
        "HOST_UID": 0, 
        "UUID": "796638da-885b-40c0-86d1-a008bac79b20", 
        "HOST_GID": 0, 
        "RUN_DIRECTORY": "/run", 
        "EXEC_STOP": "/bin/runc kill 'hello-world'", 
        "DESTDIR": "/sysroot/ostree/deploy/rhel-atomic-host/var/lib/containers/atomic/hello-world.0", 
        "EXEC_START": "/bin/runc run 'hello-world'", 
        "RECEIVER": "World", 
        "STATE_DIRECTORY": "/var/lib", 
        "PORT": "8081", 
        "NAME": "hello-world"
    }, 
    "ostree-commit": "146cb816d031632c2d2abd83e40875e9c9b1163cbb8e894e5ce0b7412a4299ff", 
    "revision": "1de36370f9c7957a5b61b3e65b531db5eac48c31f5730cf9e7e643266053c67c"
}
---

Comment 2 Yu Qi Zhang 2017-04-05 18:28:37 UTC
I think this should have been under atomic instead, so I changed the component.

In any case I fixed it here: https://github.com/projectatomic/atomic/commit/f5b00bc171d0f324f1b40cceee7b8850f3c01761

Comment 3 Alex Jia 2017-08-22 02:55:24 UTC
This issue has been verified in atomic-1.18.1-4.git64843d3.el7.x86_64.


[cloud-user@atomic-host-test-986 ~]$ rpm -q atomic skopeo
atomic-1.18.1-4.git64843d3.el7.x86_64
skopeo-0.1.23-1.git1bbd87f.el7.x86_64

[cloud-user@atomic-host-test-986 ~]$ sudo atomic install --system --name=hello-new-world  --set=RUN_DIRECTORY=/foo --set=STATE_DIRECTORY=/bar gscrivano/hello-world
Extracting to /var/lib/containers/atomic/hello-new-world.0
systemctl daemon-reload
systemctl enable hello-new-world

[cloud-user@atomic-host-test-986 ~]$ grep -E '(RUN_DIRECTORY|STATE_DIRECTORY)' /var/lib/containers/atomic/hello-new-world.0/info
        "RUN_DIRECTORY": "/foo", 
        "STATE_DIRECTORY": "/bar",

Comment 5 errata-xmlrpc 2017-09-05 10:39:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2609