Bug 1179931

Summary: Variable of init script gets overwritten preventing the startup of swift services when using multiple server configurations
Product: [Community] RDO Reporter: Luca 'remix_tj' Lorenzetto <lorenzetto.luca>
Component: openstack-swiftAssignee: Pete Zaitcev <zaitcev>
Status: CLOSED EOL QA Contact: nlevinki <nlevinki>
Severity: medium Docs Contact:
Priority: unspecified    
Version: IcehouseCC: derekh, srevivo, zaitcev
Target Milestone: ---   
Target Release: Juno   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-19 15:35:53 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:
Attachments:
Description Flags
Patch none

Description Luca 'remix_tj' Lorenzetto 2015-01-07 20:38:00 UTC
Created attachment 977543 [details]
Patch

Description of problem:

I made a configuration of swift using the guide at http://docs.openstack.org/developer/swift/replication_network.html#for-a-multiple-server-replication that requires to move configuration files from /etc/swift/ to /etc/swift/{object,container,account}-server/

When trying to start the services with e.g.:

service openstack-swift-account start

nothing happens.


Version-Release number of selected component (if applicable):
openstack-swift-1.13.1-1.el6.noarch
openstack-swift-container-1.13.1-1.el6.noarch
openstack-swift-object-1.13.1-1.el6.noarch
openstack-swift-account-1.13.1-1.el6.noarch


How reproducible:

Use /etc/swift/{object,container,account}-server/ for containing configuration files instead of standard /etc/swift/{object,container,account}-server.conf


Steps to Reproduce:
1. mv /etc/swift/object-server.conf /etc/swift/object-server/1.conf
2. service openstack-swift-object start

Actual results:

Service neither start, nor gives failed error.


Expected results:

Start services correctly or advice with failed message.

Additional info:

The issue is due to the reuse of $name variable. In /usr/share/openstack-swift/functions we have, at line 21:

 for name in $( ls "/etc/swift/$server-server/" ); do

This variable is global and not local to function swift_action(). $name is previously defined i.e. at line 20 of /etc/init.d/openstack-swift-object (and all the other openstack-swift-* scripts) and used throughout the startup script. Since the variable is immediately overwritten by the call of rh_status function (invoked before every start/stop operation), script functionality is severely impacted.

Patch provided.

Issue has been verified only on icehouse release of RDO, other version hasn't been checked.

Comment 1 Chandan Kumar 2016-05-19 15:35:53 UTC
This bug is against a Version which has reached End of Life.
If it's still present in supported release (http://releases.openstack.org), please update Version and reopen.