Fixed puppet-check's memory check on OpenBSD
OpenBSD's ps always prints the header line, even if empty.
This commit is contained in:
parent
b3ec5b3ea5
commit
9e7d80e719
1 changed files with 1 additions and 1 deletions
|
@ -26,7 +26,7 @@ begin
|
|||
Process.kill(0, pid)
|
||||
|
||||
# check memory usage and restart if over 256M
|
||||
rss = `ps -o rss= -p '#{pid}'`.to_i / 1024
|
||||
rss = `ps -o rss -p '#{pid}'`.to_a.last.to_i / 1024
|
||||
if rss > 256
|
||||
printf("puppetd memory usage too high (%d MB), on host '%s' sending HUP\n",
|
||||
rss, Socket.gethostname)
|
||||
|
|
Loading…
Add table
Reference in a new issue