X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/c536d9456ec20d08ea5802146e8ceee4b1303576..4f199b7381d639f0c604e1484d0ecb4e8d262a70:/cookbooks/squid/recipes/default.rb diff --git a/cookbooks/squid/recipes/default.rb b/cookbooks/squid/recipes/default.rb index fbfc1daef..b46cafe3a 100644 --- a/cookbooks/squid/recipes/default.rb +++ b/cookbooks/squid/recipes/default.rb @@ -98,6 +98,12 @@ file "/etc/logrotate.d/squid.dpkg-dist" do action :delete end +squid_service_exec = if node[:lsb][:release].to_f < 20.04 + "/usr/sbin/squid -YC" + else + "/usr/sbin/squid --foreground -YC" + end + systemd_service "squid" do dropin "chef" limit_nofile 98304 @@ -107,12 +113,7 @@ systemd_service "squid" do protect_home true restrict_address_families address_families restart "always" - exec_start "/usr/sbin/squid --foreground -YC" -end - -# Quick hack to cleanup bloated journal -execute "tmp_journal_clean_up" do - command "/bin/journalctl --vacuum-time=1d" + exec_start "#{squid_service_exec}" end service "squid" do