forked from deepsweet/firefox-headless-remote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirefox.eye
48 lines (38 loc) · 1.57 KB
/
firefox.eye
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
ROOT = File.expand_path(File.dirname(__FILE__))
Eye.config do
# https://serverfault.com/a/932888
logger "/proc/1/fd/1"
end
Eye.application :firefox do
working_dir ROOT
trigger :flapping, times: 10, within: 1.minute
# currently we do not want limit the cpu it is only for logs
# check :cpu, every: 30, below: 1000, times: 6
process :marionette do
pid_file 'marionette.pid'
stdall '/dev/null'
daemonize true
# start_command "/home/damir/firefox/developer-firefox/firefox-bin -marionette -profile /home/damir/firefox/profile_2/"
start_command "/usr/bin/firefox-dev -headless -marionette -profile /home/firefox/profile/"
stop_signals [:TERM, 5.seconds, :KILL]
restart_command 'kill -USR2 {PID}'
# just sleep this until process get up status
# (maybe enought to firefox soft restart)
restart_grace 5.seconds
# main process
check :memory, every: 30, below: 600.megabytes, times: [4, 4]
# with option below will calculate all children memory and kill marionette process
check :children_memory, every: 30, below: 1000.megabytes, times: [4, 4]
monitor_children do
children_update_period 5.seconds
# with option below will calculate each child memory and send kill command
check :memory, every: 10, below: 700.megabytes, times: [6, 6]
# currently we do not want limit the cpu it is only for logs
# check :cpu, every: 15, below: 1000, times: 5
# Stop with kill child
stop_command 'kill -QUIT {PID}'
# Stop with kill parent
# stop_command 'kill -USR2 {PARENT_PID}'
end
end
end