zdata-inc / ambari-extensions

zData Ambari Stack containing HAWQ, Chorus, and Greenplum
http://zdata-inc.github.io/ambari-extensions
11 stars 5 forks source link

Warning thrown during gpinitsystem if initdb has extended SELinux ACLs #6

Closed jess-sol closed 9 years ago

jess-sol commented 9 years ago

This is addressing the generated output in the logs:

[WARN]:-File permission mismatch.  The gpadmin owns the Greenplum Database installation directory.
[WARN]:-You are currently logged in as gpadmin and may not have sufficient
[WARN]:-permissions to run the Greenplum binaries and management utilities.

The issue stems from how gpinitsystem (specifically /usr/local/hawq/bin/lib/gp_bash_functions.sh, which is called by gpinitsystem) checks the file permissions for the files located in /usr/local/hawq. It does this by running ls -la on the file /usr/local/hawq/bin/initdb and running the sed commands sed -e 's/...\(.\)....../\1/g' (to retrieve the user executable permission), and -e 's/......\(.\).../\1/g' (to retrieve the group executable permission).

The issue becomes obvious when looking at the output of the ls command on an SELinux enabled system (even if it is set to permissive):

-rwxr-xr-x. 1 gpadmin root 463,708 Aug  8  2014 initdb*
          ^ Note the dot

Without the trailing dot (which signifies there are extended SELinux ACLs on the file) the sed used works correctly. With it though the sed returns 'x.', as the last dot is never matched, and therefore isn't replaced.

jess-sol commented 9 years ago

We'll disable SELinux via vagrant's provisioner for now. We'll also need to add to the documentation to disable SELinux on all machines prior to install HAWQ. Also, we should still file a bug report with Pivotal, one extra character at the end of a permissions string should not break all their scripts.

Todo: