|
We're having the same issue, running puppet apply from cron in nice. An incorrect nice level on services is the most critical issue, since they remain running, while transient execs are not so much of an issue - actually in most cases it's even desirable that they run at the same nice level.
A comprehensive solution would be nice to have, but for the moment we have a workaround for services, overriding the redhat provider. We simply read the nice level of the puppet proces from /proc/self/stat, and run nice -n (-level) /sbin/service .... Diff below for puppet 3.3.2, maybe it can help others having the same problem.
Cheers, Sergio
--- /usr/lib/ruby/site_ruby/1.8/puppet/provider/service/redhat.rb 2013-11-07 22:42:05.000000000 +0100
|
+++ puppet/modules/service/lib/puppet/provider/service/redhat.rb 2015-03-26 07:18:58.506055549 +0100
|
@@ -51,11 +51,15 @@
|
end
|
|
def restartcmd
|
- (@resource[:hasrestart] == :true) && [command(:service), @resource[:name], "restart"]
|
+ ## sash: renice to 0
|
+ nice=-(File.read("/proc/self/stat").split()[18].to_i)
|
+ (@resource[:hasrestart] == :true) && ["/bin/nice","-n","#{nice}",command(:service), @resource[:name], "restart"]
|
end
|
|
def startcmd
|
- [command(:service), @resource[:name], "start"]
|
+ ## sash: renice to 0
|
+ nice=-(File.read("/proc/self/stat").split()[18].to_i)
|
+ ["/bin/nice","-n","#{nice}",command(:service), @resource[:name], "start"]
|
end
|
|
def stopcmd
|
|