Fix for _size_shutdowns and node prices in node manager refs #5353
[arvados.git] / services / api / script / crunch-dispatch.rb
index 27cb82115b2f7993bce20b7a589bdb62eccad619..9fb25664a41eb5befe7067aef83686fb5fcdc1f6 100755 (executable)
@@ -1,5 +1,9 @@
 #!/usr/bin/env ruby
 
+# We want files written by crunch-dispatch to be writable by other processes
+# with the same GID, see bug #7228
+File.umask(0002)
+
 require 'shellwords'
 include Process
 
@@ -190,7 +194,7 @@ class Dispatcher
     # Otherwise, return nil.
     need_procs = NODE_CONSTRAINT_MAP.each_pair.map do |job_key, node_key|
       Proc.new do |node|
-        positive_int(node.info[node_key], 0) >=
+        positive_int(node.properties[node_key], 0) >=
           positive_int(job.runtime_constraints[job_key], 0)
       end
     end
@@ -747,6 +751,7 @@ class Dispatcher
 
   def run
     act_as_system_user
+    User.first.group_permissions
     $stderr.puts "dispatch: ready"
     while !$signal[:term] or @running.size > 0
       read_pipes