Skip to content

Commit

Permalink
always restart chrony on a crash
Browse files Browse the repository at this point in the history
Summary:
If chrony crashes it doesn't get restarted by systemd which leaves us until next chef run to restart.
This diff adds `Restart = always` directive which will resurrect the service

Differential Revision: D61338001

fbshipit-source-id: 1ad4a1422df0fb254f71576f6d1bdd3460bee487
  • Loading branch information
leoleovich authored and facebook-github-bot committed Aug 15, 2024
1 parent 78efef7 commit 7a9b479
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions cookbooks/fb_chrony/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
supports 'rocky'
supports 'ubuntu'
depends 'fb_helpers'
depends 'fb_systemd'
14 changes: 13 additions & 1 deletion cookbooks/fb_chrony/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,20 @@
notifies :restart, 'service[chrony]'
end

fb_systemd_override 'chronyd_override' do
unit_name 'chronyd.service'
content({
'Service' => {
'Restart' => 'always',
},
})
end

service 'chrony' do
service_name chrony_svc
action [:enable, :start]
subscribes :restart, 'package[chrony]'
subscribes :restart, [
'package[chrony]',
'fb_systemd_override[chronyd_override]',
]
end

0 comments on commit 7a9b479

Please sign in to comment.