From: Tom Hughes Date: Thu, 14 Nov 2019 20:43:55 +0000 (+0000) Subject: Remount /dev/shm if the size is changed X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/aafc16453dccd413bf152b1c269a5123c6749742 Remount /dev/shm if the size is changed --- diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index 454386459..110273d82 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -537,10 +537,18 @@ unless Dir.glob("/sys/class/hwmon/hwmon*").empty? end if node[:hardware][:shm_size] + execute "remount-dev-shm" do + action :nothing + command "/bin/mount -o remount /dev/shm" + user "root" + group "root" + end + mount "/dev/shm" do - action [:mount, :enable] + action :enable device "tmpfs" fstype "tmpfs" options "rw,nosuid,nodev,size=#{node[:hardware][:shm_size]}" + notifies :run, "execute[remount-dev-shm]" end end