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

Added ability to remove nssm parameters #263

Merged
merged 5 commits into from
Feb 3, 2016
Merged

Added ability to remove nssm parameters #263

merged 5 commits into from
Feb 3, 2016

Conversation

Ginja
Copy link
Contributor

@Ginja Ginja commented Jan 21, 2016

  • You can now remove previously set nssm parameters by setting the hash values to '' for Strings, & 0 for Integers. Also improved how the Consul service is stopped on Windows. If you don't stop it before you remove it, you end up in a SERVICE_PAUSED state.
  • Fixes Idempotency #262
  • Fixed an edge case when stopping the service on Windows
  • Removed problematic reload line. new_resource.notifies(:reload, new_resource, :delayed) causes the consul_service resource to reload every time Chef ran. This is an issue with the new sysvinit service provider when the service is in a stopped state when Chef runs. It would start and recieve a reload HUP too quickly & subsequently crash the service.
  • Added attribute for specifying install_path for consul_service resource. My reasoning is that one should be able to change this crucial property without having to redeclare the whole resource.

@codecov-io
Copy link

Current coverage is 67.10%

Merging #263 into master will increase coverage by +18.43% as of 2dce63b

@@            master   #263   diff @@
=====================================
  Files            7      7       
  Stmts          378    377     -1
  Branches         0      0       
  Methods          0      0       
=====================================
+ Hit            184    253    +69
  Partial          0      0       
+ Missed         194    124    -70

Review entire Coverage Diff as of 2dce63b

Powered by Codecov. Updated on successful CI builds.

@johnbellone
Copy link
Contributor

Would you mind rebasing?

You can now remove previously set nssm parameters by setting the hash
values to '' for Strings, & 0 for Integers. Also improved how the
Consul service is stopped on Windows. If you don't stop it before
you remove it, you end up in a SERVICE_PAUSED state.
If nssm reported SERVICE_PAUSED for the consul service, the nssm
resource was unable to remove it. Altered the service status check
so it's flexible to handle multiple exit statuses.
It appears the nssm resource also isn't idempotent. I also added
another attribute and made it the default value for the install_path
property for consul_service. My reasoning is that one should be able
to change this crucial property without having to redeclare the whole
resource. #262 will be fixed for linux once
johnbellone/libartifact-cookbook#2 is merged
`new_resource.notifies(:reload, new_resource, :delayed)` causes the
`consul_service` resource to reload every time Chef ran. This is
an issue with the new sysvinit service provider when the service is
in a stopped state when Chef runs. It would start and recieve a reload
HUP too quickly & subsequently crash the service.
@legal90 kindly pointed out that the default value for
['consul']['config']['data_dir'] & ['consul']['service']['data_dir']
was changed to append 'data' as the last folder. Consul actually
creates this directory for you when you start the service. And if
you didn't change both, it could cause the Consul agent to fail.
@Ginja
Copy link
Contributor Author

Ginja commented Feb 2, 2016

Done.

@Ginja
Copy link
Contributor Author

Ginja commented Feb 2, 2016

The tests pass locally on my machine. It looks like a one-off issue.

johnbellone added a commit that referenced this pull request Feb 3, 2016
Added ability to remove nssm parameters
@johnbellone johnbellone merged commit 257a086 into sous-chefs:master Feb 3, 2016
@knightorc knightorc deleted the nssm-param-reset branch June 6, 2018 23:05
@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Idempotency
3 participants