Skip to content

Commit fca5ef7

Browse files
committed
Pause all snap auto-updates and daily timers
1 parent d91c553 commit fca5ef7

File tree

1 file changed

+21
-0
lines changed
  • cookbooks/boxcutter_site_settings/recipes

1 file changed

+21
-0
lines changed

cookbooks/boxcutter_site_settings/recipes/default.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,27 @@
3434
node.default['fb_apt']['config']['APT::Periodic::Unattended-Upgrade'] = '0'
3535
# Do "apt-get autoclean" every n-days (0=disable)
3636
node.default['fb_apt']['config']['APT::Periodic::AutocleanInterval'] = '0'
37+
38+
%w(
39+
apt-daily.timer
40+
apt-daily.service
41+
apt-daily-upgrade.timer
42+
apt-daily-upgrade.service
43+
).each do |unit|
44+
service unit do
45+
action [:stop, :disable]
46+
end
47+
end
48+
49+
# Some snap applications will refuse to start if the snap daemon is disabled
50+
# so instead put auto-updates on pause
51+
# https://snapcraft.io/docs/managing-updates
52+
execute 'disable snap auto-updates' do
53+
command 'snap refresh --hold'
54+
not_if 'snap get system refresh.hold | grep -w forever'
55+
only_if { ::File.exist?('/usr/bin/snap') }
56+
action :run
57+
end
3758
end
3859

3960
include_recipe 'boxcutter_users'

0 commit comments

Comments
 (0)