Skip to content

Commit

Permalink
Improve robustness of systemd service configuration
Browse files Browse the repository at this point in the history
This is as good as we can get until
hashicorp/vault#5079 is merged.

Notified restarts will still NOT cause a Chef run failure, although any
subsequest (re)starts WILL.
  • Loading branch information
bmhughes committed Jan 13, 2021
1 parent e75795f commit 978e721
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions libraries/helpers.rb
Expand Up @@ -101,6 +101,7 @@ def default_vault_unit_content
'StartLimitBurst' => 3,
},
'Service' => {
'Type' => 'exec',
'User' => user,
'Group' => group,
'ProtectSystem' => 'full',
Expand Down
2 changes: 2 additions & 0 deletions resources/service.rb
Expand Up @@ -58,6 +58,8 @@
def do_service_action(resource_action)
with_run_context(:root) do
edit_resource(:service, new_resource.service_name.delete_suffix('.service')) do
supports status: true, restart: true, reload: true

action :nothing
delayed_action resource_action
end
Expand Down

0 comments on commit 978e721

Please sign in to comment.