Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RDO tickets are now tracked in Jira https://issues.redhat.com/projects/RDO/issues/

Bug 1114100

Summary: Packstack fails installing swift with "Could not find command 'restorecon'"
Product: [Community] RDO Reporter: Lars Kellogg-Stedman <lars>
Component: openstack-packstackAssignee: Martin Magr <mmagr>
Status: CLOSED DUPLICATE QA Contact: Ami Jeain <ajeain>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: aortega, derekh, yeylon
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-27 17:51:54 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 Lars Kellogg-Stedman 2014-06-27 17:45:32 UTC
With packstack openstack-packstack-2014.1.1-0.21.dev1157.1.el6.noarch on CentOS 6.5, running "packstack --allinone" resulted in:

    ERROR : Error appeared during Puppet run: 172.16.0.2_swift.pp
    Error: /Stage[main]/Main/Swift::Storage::Loopback[swift_loopback]/Swift::Storage::Ext4[swift_loopback]/Swift::Storage::Mount[swift_loopback]/Exec[restorecon_mount_swift_loopback]: Failed to call refresh: Could not find command 'restorecon'

The restorecon command does exist:

    # which restorecon
    /sbin/restorecon

    # restorecon -h
    Full path required for exclude: net:[4026532178].
    restorecon: invalid option -- 'h'
    usage:  restorecon [-iFnprRv0] [-e excludedir ] [-o filename ] [-f filename | pathname... ]


The problem is in swift/manifests/storage/mount.pp, which contains:

  if ($::selinux) {
    exec { "restorecon_mount_${name}":
      command     => "restorecon ${mnt_base_dir}/${name}",
      path        => ['/usr/sbin', '/bin'],
      subscribe   => Exec["mount_${name}"],
      before      =>  Exec["fix_mount_permissions_${name}"],
      refreshonly => true,
    }
  }

Notice the "path" setting; this will never find "restorecon" on CentOS 6.5 (and probably not on RHEL 6.5 either).

Comment 1 Lars Kellogg-Stedman 2014-06-27 17:51:54 UTC

*** This bug has been marked as a duplicate of bug 1109079 ***