-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
memory_watch.rb:
cmd = "ps x |grep '#{self.watch_string}' |grep -v grep | awk '{print $1}'"
This does not list processes that are run by different user than the one running weasel. I'd rather run weasel as root from crontab and let it kill unicorn workers that are run as www-data.
Should probably be "ps ax". Also you could use sys-proctable gem instead.
It would be great too if weasel said something if it didn't find any processes matching with the watch statement. Also it could process .conf files from something like /etc/weasel.d/ that could look something like:
#unicorn.conf
watch "unicorn_rails worker"
callback %x{kill -QUIT #{pid.to_s}}
num_cycles 3
num_over_marks 2
callback_message "foo foo foo"
high_water_mb 200
delay 1
Metadata
Metadata
Assignees
Labels
No labels