[OCF] mysql fails to start if we have own bash script in /etc/profile.d

Bug #1630561 reported by Michael Kraynov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
Medium
Oleksiy Molchanov
Newton
Fix Committed
Medium
Oleksiy Molchanov

Bug Description

During mysql start there is a check which is using "sh" shell.
The check is done on line 672 of "/usr/lib/ocf/resource.d/fuel/mysql-wss".
And that will, according to "/etc/profiles", start everything in "/etc/profile.d/"

if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi

The problem is that if there is anything inside that directory which works only with "bash" execution, it fails, and MySQL does not start.

Expected results:
MySQL OCF script should ignore other scripts or work with bash execution.

Description of the environment:
Mirantis OpenStack 9.0

Revision history for this message
Alexander Rubtsov (arubtsov) wrote :

sla2 for 9.0-updates

Changed in fuel:
milestone: none → 9.1
importance: Undecided → Medium
tags: added: sla2
Changed in fuel:
status: New → Confirmed
assignee: nobody → Fuel Sustaining (fuel-sustaining-team)
tags: added: area-library pacemaker
Changed in fuel:
milestone: 9.1 → 9.2
Revision history for this message
Michael Kraynov (mkraynov) wrote :

Hello there is a small recomendation for fix the issue:

In the MySQL OCF script, instead of starting a shell and using the internal test, it would be better to call /usr/bin/test

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

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

Changed in fuel:
assignee: Fuel Sustaining (fuel-sustaining-team) → Oleksiy Molchanov (omolchanov)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-library (master)

Reviewed: https://review.openstack.org/391215
Committed: https://git.openstack.org/cgit/openstack/fuel-library/commit/?id=594842a63e7729d514bd658a38d615b32190ac25
Submitter: Jenkins
Branch: master

commit 594842a63e7729d514bd658a38d615b32190ac25
Author: Oleksiy Molchanov <email address hidden>
Date: Thu Oct 27 17:20:00 2016 +0300

    Change approach how to check whether directory is writable

    Closes-Bug: 1630561
    Change-Id: I4af7d480cc4481ffa8c91a599aec2458f4124d6f

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
Alexander Rubtsov (arubtsov) wrote :

The fix has been merged to master, however Launchpad attributes show status "Fix committed" against 9.2 milestone. I'm going to back status for 9.2 to "confirmed" since we still need backport for customer

Changed in fuel:
status: Fix Committed → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-library (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/395519

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-library (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/395520

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-library (stable/newton)

Change abandoned by Oleksiy Molchanov (<email address hidden>) on branch: stable/newton
Review: https://review.openstack.org/395519

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-library (stable/mitaka)

Change abandoned by Oleksiy Molchanov (<email address hidden>) on branch: stable/mitaka
Review: https://review.openstack.org/395520

Revision history for this message
Oleksiy Molchanov (omolchanov) wrote :

Reverting existing patch, marking as confirmed.

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

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

Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-library (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/397212

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-library (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/397213

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-library (stable/newton)

Change abandoned by Oleksiy Molchanov (<email address hidden>) on branch: stable/newton
Review: https://review.openstack.org/395519

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-library (stable/mitaka)

Change abandoned by Oleksiy Molchanov (<email address hidden>) on branch: stable/mitaka
Review: https://review.openstack.org/395520

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-library (master)

Reviewed: https://review.openstack.org/397207
Committed: https://git.openstack.org/cgit/openstack/fuel-library/commit/?id=21cca3d9730a246ba2f4131288a1ead3e549d28e
Submitter: Jenkins
Branch: master

commit 21cca3d9730a246ba2f4131288a1ead3e549d28e
Author: Oleksiy Molchanov <email address hidden>
Date: Mon Nov 14 16:15:49 2016 +0200

    Change approach how to check whether directory is writable

    Change-Id: Ice7c8f964246f4abd3619906aa4404ea826a9606
    Closes-Bug: 1630561

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-library (stable/newton)

Reviewed: https://review.openstack.org/397212
Committed: https://git.openstack.org/cgit/openstack/fuel-library/commit/?id=7508e060558430d1c9e17805b0868e9608fdf51e
Submitter: Jenkins
Branch: stable/newton

commit 7508e060558430d1c9e17805b0868e9608fdf51e
Author: Oleksiy Molchanov <email address hidden>
Date: Mon Nov 14 16:15:49 2016 +0200

    Change approach how to check whether directory is writable

    Change-Id: Ice7c8f964246f4abd3619906aa4404ea826a9606
    Closes-Bug: 1630561

tags: added: in-stable-mitaka
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-library (stable/mitaka)

Reviewed: https://review.openstack.org/397213
Committed: https://git.openstack.org/cgit/openstack/fuel-library/commit/?id=fcd091a3374db46d23d8910f28200bdef5242735
Submitter: Jenkins
Branch: stable/mitaka

commit fcd091a3374db46d23d8910f28200bdef5242735
Author: Oleksiy Molchanov <email address hidden>
Date: Mon Nov 14 16:15:49 2016 +0200

    Change approach how to check whether directory is writable

    Change-Id: Ice7c8f964246f4abd3619906aa4404ea826a9606
    Closes-Bug: 1630561

tags: added: on-verification
Revision history for this message
TatyanaGladysheva (tgladysheva) wrote :

Verified on 9.2 snapshot #580.

Steps to verify:
1) Deploy the environment: 1 controller + 1 compute with cinder.
2) Create new file test.sh with any content (in my case it was python script) in /etc/profile.d folder
3) crm resource stop clone_p_mysqld
4) crm resource stop clone_p_mysqld
5) ps axuf | grep mysql, observe /var/log/mysql/mysqld.log

Actual result:
Mysql starts successfully: https://paste.mirantis.net/show/2826/

tags: removed: on-verification
Changed in fuel:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/fuel-library 11.0.0.0rc1

This issue was fixed in the openstack/fuel-library 11.0.0.0rc1 release candidate.

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.