Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pcsd RHEL6/C6 compatibility #48

Closed
wants to merge 2 commits into from

Conversation

deriamis
Copy link

This commit would fix both pcs and pcsd compatibility with RHEL 6/CentOS 6 when the required software versions are actually installed (such as with a custom RPM):

  1. All checks for "release 6" via /etc/redhat-release were converted to checks for required software versions instead.
  2. The logic for "is_rhel6" was reversed to "is_rhel7_compat"
  3. All references to systemd or systemctl were placed behind conditionals specific to systemd being installed. Some of these were previously if_rhel6 checks.
  4. pcsd/ssl.rb has been modified so daemonizing pcsd will now work on both RHEL 6 and RHEL 7. On RHEL 6, the systemd callback is not used and WEBRick::Daemon::start is called instead so it forks properly.
  5. The top-level Makefile has been altered to check for the presence of systemctl when installing init files so it won't install systemd stuff if it's not there, but it will install the init script in that case.
  6. pcsd/Makefile was modified so it considers the Ruby gems a dependency of build_gems (which won't try downloading gems), and it doesn't try to differentiate between RHEL 6 and RHEL 7 gems anymore.
  7. pcsd/Gemfile (and pcsd/Gemfile.lock) have been modified so that the one problematic gem in RHEL 6 (rpam-ruby19-feist) is now pulled from a git repository instead.
  8. Some dependencies were not being included in pcsd/Gemfile (and pcsd/Gemfile.lock), and they have been added so the build from makefile works correctly.
  9. pcsd/pscd.rb was modified so it requires bundler/setup and executes Bundler.setup(:default), which allows rpam-ruby19-feist to be used (since rubygems won't do it).
  10. pcsd/pcsd (the init script) was modified to execute via bundler rather than directly with ruby, which allows the bundled gems to be required properly (needed for rpam-ruby19-feist).
  11. A few text changes to errors so the compatibility check is more obvious (saying "this isn't RHEL 7" versus "you're using X software").

I know this is a large commit, but I really did not see any way of breaking it up into something more manageable in this case. I have tested this on a RHEL 6 box, but I don't have access to a RHEL 7 box at the moment to do further testing. I don't imagine any of the changes I made would be a problem for that, though. Please do let me know if you have any questions or suggestions!

Ryan Egesdahl added 2 commits September 12, 2014 16:41
* Remove binary paths in is_rhel7_compat() so settings.py can be used instead
@feist
Copy link
Collaborator

feist commented Sep 17, 2014

Thanks for all of these fixes. I'm planning on pulling most of them in in the next couple of weeks, with some minor changes.

@deriamis
Copy link
Author

No problem! I'm going to be doing a lot of testing on server clusters coming up, and I've noticed some things like what happens when a connection does not succeed to pcsd on the remote server (it's not graceful). Is that something you are working on right now? I'd be happy to create pull requests for that stuff as well if you'd like.

@tomjelinek
Copy link
Member

Thank you very much for this patch and sorry for the delay.

  1. We need to take a closer look at this. Running corosync and pacemaker to determine their version is much slower than reading a file.
  2. I'm not going to accept these changes. We focus mainly on latest software releases so we want any code dealing with older software to be a special case and not the other way around. Therefore it's better to have is_rhel6 function and possibly add is_rhel7 function when working on RHEL 8.
  3. Great, this has been cherry-picked f1a8b48
  4. Partially cherry-picked f1a8b48
  5. Great, this has been cherry-picked f1a8b48
  6. to 9) We will deal with these changes later.
  7. cherry-picked 639ed58

@tomjelinek
Copy link
Member

I did a review of the remaining proposed changes and implemented some of them in ecfdc73. As bundler is not available on RHEL 6 as a RPM package I'm not going to accept some changes related to it.

  1. pcsd/Makefile was modified so it considers the Ruby gems a dependency of build_gems (which won't try downloading gems), and it doesn't try to differentiate between RHEL 6 and RHEL 7 gems anymore.

Accepted. Original RHEL 6 line left in the Makefile for anyone who doesn't have bundler installed.

  1. pcsd/Gemfile (and pcsd/Gemfile.lock) have been modified so that the one problematic gem in RHEL 6 (rpam-ruby19-feist) is now pulled from a git repository instead.

Accepted. I changed the location of the gem though.

  1. Some dependencies were not being included in pcsd/Gemfile (and pcsd/Gemfile.lock), and they have been added so the build from makefile works correctly.

Added missing json dependency. Sinatra-reloader is part of sinatra-contrib gem so I'm not adding it.

  1. pcsd/pscd.rb was modified so it requires bundler/setup and executes Bundler.setup(:default), which allows rpam-ruby19-feist to be used (since rubygems won't do it).

Rejected, bundler is not available on RHEL 6 as a RPM package and it works for me just fine without accepting the change.

  1. pcsd/pcsd (the init script) was modified to execute via bundler rather than directly with ruby, which allows the bundled gems to be required properly (needed for rpam-ruby19-feist).

We are going to make more changes to the init script later as there are issues with it anyways.

@tomjelinek tomjelinek closed this Oct 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants