From aafc16453dccd413bf152b1c269a5123c6749742 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 14 Nov 2019 20:43:55 +0000 Subject: [PATCH] Remount /dev/shm if the size is changed --- cookbooks/hardware/recipes/default.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 2.43.2