wrong if root check at extend_start

Bug #1690360 reported by Eduardo Gonzalez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla
Fix Released
High
Eduardo Gonzalez
Ocata
Fix Released
High
Eduardo Gonzalez
Pike
Fix Released
High
Eduardo Gonzalez

Bug Description

Some images have a check to clean and source apache environment variables when the user is root.
However this check is not evaluating properly:

if [[ $USER == "root" ]]; then
    echo "root" > /tmp/user
else
    echo "nonroot" > /tmp/user
    whoami >> /tmp/user
fi

In ubuntu causes this output not evaluating correctly the first condition

docker exec cinder_api cat /tmp/user
nonroot
root

This is fixed changing to if [[ $EUID -eq 0 ]]

Error while launched cinder-api under apache:

Running command: '/usr/sbin/apache2 -DFOREGROUND'
[Fri May 12 12:13:13.958660 2017] [core:warn] [pid 6] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Fri May 12 12:13:13.958720 2017] [core:warn] [pid 6] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Fri May 12 12:13:13.958731 2017] [core:warn] [pid 6] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Fri May 12 12:13:13.958736 2017] [core:warn] [pid 6] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Fri May 12 12:13:13.958744 2017] [core:warn] [pid 6] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri May 12 12:13:13.961974 2017] [core:warn] [pid 6:tid 139992602384256] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri May 12 12:13:13.962176 2017] [core:warn] [pid 6:tid 139992602384256] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri May 12 12:13:13.962193 2017] [core:warn] [pid 6:tid 139992602384256] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla (master)

Fix proposed to branch: master
Review: https://review.openstack.org/464181

description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla (master)

Reviewed: https://review.openstack.org/464181
Committed: https://git.openstack.org/cgit/openstack/kolla/commit/?id=45c54d7959a04dd95e871d6d00dd0fb84a5126d0
Submitter: Jenkins
Branch: master

commit 45c54d7959a04dd95e871d6d00dd0fb84a5126d0
Author: egonzalez90 <email address hidden>
Date: Fri May 12 12:56:13 2017 +0100

    Fix if $user is root at extend_start

    In ubuntu is not evaluating correctly
    if $user == root check at extend_start.

    Changing to "$(whoami)" == 'root' fixes the issue

    Change-Id: I296a1f98764cdfa09650c483bc7beba53e6bdba4
    Closes-Bug: #1690360

Changed in kolla:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/464230

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla (stable/ocata)

Reviewed: https://review.openstack.org/464230
Committed: https://git.openstack.org/cgit/openstack/kolla/commit/?id=002cb099ef459ba567222d76c9958a2866b752e3
Submitter: Jenkins
Branch: stable/ocata

commit 002cb099ef459ba567222d76c9958a2866b752e3
Author: egonzalez90 <email address hidden>
Date: Fri May 12 12:56:13 2017 +0100

    Fix if $user is root at extend_start

    In ubuntu is not evaluating correctly
    if $user == root check at extend_start.

    Changing to "$(whoami)" == 'root' fixes the issue

    Change-Id: I296a1f98764cdfa09650c483bc7beba53e6bdba4
    Closes-Bug: #1690360
    (cherry picked from commit 45c54d7959a04dd95e871d6d00dd0fb84a5126d0)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla 5.0.0.0b2

This issue was fixed in the openstack/kolla 5.0.0.0b2 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla 4.0.2

This issue was fixed in the openstack/kolla 4.0.2 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.