recipiez 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/recipiez/version.rb +1 -1
- data/recipes/monit.rb +7 -0
- data/recipes/node.rb +0 -1
- data/recipes/templates/node_monit.erb +9 -0
- data/recipes/templates/upstart.erb +1 -0
- metadata +5 -4
data/lib/recipiez/version.rb
CHANGED
data/recipes/monit.rb
CHANGED
@@ -43,6 +43,13 @@ Capistrano::Configuration.instance(true).load do
|
|
43
43
|
sudo "chown root:root /etc/monit/monitrc"
|
44
44
|
sudo "/etc/init.d/monit restart"
|
45
45
|
end
|
46
|
+
|
47
|
+
desc "configures monit for node"
|
48
|
+
task :node, :roles => :web do
|
49
|
+
put render('node_monit', binding), "node_monit.conf"
|
50
|
+
sudo "mv node_monit.conf /etc/monit/conf.d/node_monit_#{application}.conf"
|
51
|
+
sudo "/etc/init.d/monit restart"
|
52
|
+
end
|
46
53
|
|
47
54
|
|
48
55
|
end
|
data/recipes/node.rb
CHANGED
@@ -0,0 +1,9 @@
|
|
1
|
+
# node
|
2
|
+
check process node_<%= application %> with pidfile /var/run/<%= application %>.pid
|
3
|
+
start program = "/sbin/start <%= application %>"
|
4
|
+
stop program = "/sbin/stop <%= application %>"
|
5
|
+
if cpu is greater than 40% for 2 cycles then alert
|
6
|
+
if cpu > 80% for 5 cycles then restart
|
7
|
+
if 10 restarts within 10 cycles then timeout
|
8
|
+
if totalmem > 150.0 MB for 5 cycles then restart
|
9
|
+
group node
|
@@ -10,6 +10,7 @@ respawn # restart when job dies
|
|
10
10
|
respawn limit 5 60 # give up restart after 5 respawns in 60 seconds
|
11
11
|
|
12
12
|
script
|
13
|
+
echo $$ > /var/run/<%= application %>.pid
|
13
14
|
exec sudo -u <%= user %> NODE_ENV=<%= node_env %> node <%= current_path %>/app/app.js >> <%= current_path %>/log/<%= node_env %>.log 2>&1
|
14
15
|
end script
|
15
16
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recipiez
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alastair Brunton
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-12-
|
18
|
+
date: 2011-12-21 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -80,6 +80,7 @@ files:
|
|
80
80
|
- recipes/templates/nginx_monit.erb
|
81
81
|
- recipes/templates/nginx_node.erb
|
82
82
|
- recipes/templates/nginx_vhost.erb
|
83
|
+
- recipes/templates/node_monit.erb
|
83
84
|
- recipes/templates/passenger_vhost.erb
|
84
85
|
- recipes/templates/php_handler.erb
|
85
86
|
- recipes/templates/php_vhost.erb
|