]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Remount /dev/shm if the size is changed
[chef.git] / cookbooks / hardware / recipes / default.rb
index 454386459ce800658b4cd5fe571fdc8214ed4354..110273d82cfc68bfffc82dbbff6281920776ff74 100644 (file)
@@ -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