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

add systemd service for amazon linux 2 #2901

Merged
merged 2 commits into from
Apr 5, 2018
Merged

Conversation

zakhark
Copy link
Contributor

@zakhark zakhark commented Mar 29, 2018

Right now service Amazon Linux is treated as upstart_service while Amazon Linux 2 is systemd.
It causes issues like #2639

On the Amazon Linux 2 Candidate, os[:release] returns "2.0", so I'm using .start_with?('2.') here in case they'll use something 2.x in the future.
(Amazon Linux 1 returns something like "2016.09")

Signed-off-by: Zakhar Kleyman zakhar.kleyman@mongodb.com

@zakhark zakhark requested a review from a team as a code owner March 29, 2018 19:31
Signed-off-by: Zakhar Kleyman <zakhar.kleyman@mongodb.com>
@zakhark
Copy link
Contributor Author

zakhark commented Mar 29, 2018

I see that the https://travis-ci.org/chef/inspec/builds/359998634 test for the original commit that was missing DCO was green but the current https://travis-ci.org/chef/inspec/builds/359999391 failed.

The only difference between those 2 was the DCO message, I don't think that could have caused the test to fail. Can it be a flaky test?

Let me know If you have any suggestions on how to approach this (re-run the test, fix something in the code, submit a new pr, etc).

@TrevorBramble
Copy link
Contributor

@zakhark Green on re-run. Possibly flaky!

Copy link
Contributor

@jquick jquick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @zakhark !

Copy link
Contributor

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @zakhark for uncovering this!

@@ -162,7 +162,11 @@ def select_service_mgmt # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticCom
elsif %w{aix}.include?(platform)
SrcMstr.new(inspec)
elsif %w{amazon}.include?(platform)
Upstart.new(inspec, service_ctl)
if os[:release].start_with?('2.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since 2.x will be the new default, I am curious if we should turn the logic the other way: use systemd as a default for amazon linux and just use upstart if the version string starts with 20\d\d

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a very good point, I've updated the logic

Signed-off-by: Zakhar Kleyman <zakhar.kleyman@mongodb.com>
Copy link
Contributor

@miah miah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @zakhark !

Copy link
Contributor

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @zakhark

@jquick jquick added the Type: Enhancement Improves an existing feature label Apr 5, 2018
@jquick jquick merged commit bcff97a into inspec:master Apr 5, 2018
@zakhark zakhark deleted the amazon2 branch April 12, 2022 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Improves an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants