itamae-plugin-recipe-god 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +25 -2
- data/itamae-plugin-recipe-god.gemspec +3 -2
- data/lib/itamae/plugin/recipe/god/install.rb +25 -5
- data/lib/itamae/plugin/recipe/god/templates/etc/init.d/god.erb +5 -5
- data/lib/itamae/plugin/recipe/god/templates/etc/systemd/system/god.service.erb +11 -0
- data/lib/itamae/plugin/recipe/god/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a930b01b32d4c5505827ce2c60bd4b806f6c052a
|
4
|
+
data.tar.gz: b5e5c9e76b403ad54ced1c1bd4fa7609663cf3dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 776d07bb42bff649c95a00252517d455219201cf7543afb847fed9ac8155a0ef9a55e5e5acecf881192d608c58db4f4f0d16ba497f6d5a2a6a7b10c22bffe342
|
7
|
+
data.tar.gz: e813326b65b471507024b181a0e5b8ec8b39bac154f24946fb1f6d9fa2b64165253daf79c6fe5f68bb4ea59fef6ab4b1eda9d87078a1ccffc7d4a768cf3c3c82
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Itamae::Plugin::Recipe::God
|
2
2
|
|
3
|
-
itamae
|
3
|
+
itamae recipe for god process monitoring framework
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -20,7 +20,30 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
23
|
+
Include this recpie as:
|
24
|
+
|
25
|
+
include_recipe 'god'
|
26
|
+
|
27
|
+
This recipe will install god and generate the following files.
|
28
|
+
|
29
|
+
* /etc/god/master.conf
|
30
|
+
|
31
|
+
This is the master file for god configuration. It loads all cofiguration files with extension .god under the directory /etc/god/
|
32
|
+
|
33
|
+
* /etc/logrotate.d/god
|
34
|
+
|
35
|
+
god writes logfile to /var/log/god.log.
|
36
|
+
This recipe generages logrotation config file to rotate it on daily basis.
|
37
|
+
|
38
|
+
* /etc/init.d/god
|
39
|
+
|
40
|
+
service script for SysV init.
|
41
|
+
If the system does not use systemd such as CentOS6, configure for SysV init.
|
42
|
+
|
43
|
+
* /etc/systemd/system/god.service
|
44
|
+
|
45
|
+
Systemd Unit File.
|
46
|
+
If CentOS7, configure for systemd.
|
24
47
|
|
25
48
|
## Development
|
26
49
|
|
@@ -8,8 +8,9 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["y-matsuda"]
|
9
9
|
spec.email = ["matsuda@lab.acs-jp.com"]
|
10
10
|
|
11
|
-
spec.summary = %q{itamae
|
12
|
-
spec.description = %q{itamae
|
11
|
+
spec.summary = %q{itamae recipe for god process monitoring framework}
|
12
|
+
spec.description = %q{itamae recipe for god process monitoring framework}
|
13
|
+
spec.homepage = "https://github.com/maedadev/itamae-plugin-recipe-god"
|
13
14
|
spec.license = "MIT"
|
14
15
|
|
15
16
|
# Specify which files should be added to the gem when it is released.
|
@@ -17,11 +17,31 @@ template '/etc/god/master.conf' do
|
|
17
17
|
mode '644'
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
service_variables = {
|
21
|
+
pid: '/var/run/god.pid',
|
22
|
+
config: '/etc/god/master.conf',
|
23
|
+
log: '/var/log/god.log',
|
24
|
+
log_level: 'info'
|
25
|
+
}
|
26
|
+
|
27
|
+
case "#{node.platform_family}-#{node.platform_version}"
|
28
|
+
when /rhel-7\.(.*?)/
|
29
|
+
which_god = run_command('which god')
|
30
|
+
template '/etc/systemd/system/god.service' do
|
31
|
+
user 'root'
|
32
|
+
owner 'root'
|
33
|
+
group 'root'
|
34
|
+
mode '755'
|
35
|
+
variables service_variables.merge({command: which_god.stdout.chomp})
|
36
|
+
end
|
37
|
+
else
|
38
|
+
template '/etc/init.d/god' do
|
39
|
+
user 'root'
|
40
|
+
owner 'root'
|
41
|
+
group 'root'
|
42
|
+
mode '755'
|
43
|
+
variables service_variables
|
44
|
+
end
|
25
45
|
end
|
26
46
|
|
27
47
|
template '/etc/logrotate.d/god' do
|
@@ -8,16 +8,16 @@
|
|
8
8
|
|
9
9
|
. /etc/rc.d/init.d/functions
|
10
10
|
|
11
|
-
PID
|
12
|
-
CONFIG
|
13
|
-
LOG
|
11
|
+
PID=<%= @pid %>
|
12
|
+
CONFIG=<%= @config %>
|
13
|
+
LOG=<%= @log %>
|
14
14
|
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
15
15
|
RETVAL=0
|
16
16
|
|
17
17
|
case "$1" in
|
18
18
|
start)
|
19
19
|
echo -n 'Starting god: '
|
20
|
-
god -P $PID -c $CONFIG -l $LOG --log-level
|
20
|
+
god -P $PID -c $CONFIG -l $LOG --log-level <%= @log_level %>
|
21
21
|
echo
|
22
22
|
RETVAL=$?
|
23
23
|
;;
|
@@ -32,7 +32,7 @@ case "$1" in
|
|
32
32
|
god quit
|
33
33
|
echo
|
34
34
|
echo -n 'Starting god: '
|
35
|
-
god -P $PID -c $CONFIG -l $LOG --log-level
|
35
|
+
god -P $PID -c $CONFIG -l $LOG --log-level <%= @log_level %>
|
36
36
|
echo
|
37
37
|
RETVAL=$?
|
38
38
|
;;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
[Unit]
|
2
|
+
Description=God: A process monitoring framework in Ruby
|
3
|
+
After=network.target
|
4
|
+
|
5
|
+
[Service]
|
6
|
+
PIDFile=<%= @pid %>
|
7
|
+
ExecStart=<%= @command %> -c <%= @config %> -P <%= @pid %> -l <%= @log %> --log-level <%= @log_level %>
|
8
|
+
ExecStop=<%= @command %> quit
|
9
|
+
|
10
|
+
[Install]
|
11
|
+
WantedBy=multi-user.target
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itamae-plugin-recipe-god
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- y-matsuda
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: itamae
|
@@ -72,7 +72,7 @@ dependencies:
|
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '10.0'
|
75
|
-
description: itamae
|
75
|
+
description: itamae recipe for god process monitoring framework
|
76
76
|
email:
|
77
77
|
- matsuda@lab.acs-jp.com
|
78
78
|
executables: []
|
@@ -95,8 +95,9 @@ files:
|
|
95
95
|
- lib/itamae/plugin/recipe/god/templates/etc/god/master.conf.erb
|
96
96
|
- lib/itamae/plugin/recipe/god/templates/etc/init.d/god.erb
|
97
97
|
- lib/itamae/plugin/recipe/god/templates/etc/logrotate.d/god.erb
|
98
|
+
- lib/itamae/plugin/recipe/god/templates/etc/systemd/system/god.service.erb
|
98
99
|
- lib/itamae/plugin/recipe/god/version.rb
|
99
|
-
homepage:
|
100
|
+
homepage: https://github.com/maedadev/itamae-plugin-recipe-god
|
100
101
|
licenses:
|
101
102
|
- MIT
|
102
103
|
metadata: {}
|
@@ -119,5 +120,5 @@ rubyforge_project:
|
|
119
120
|
rubygems_version: 2.5.2.3
|
120
121
|
signing_key:
|
121
122
|
specification_version: 4
|
122
|
-
summary: itamae
|
123
|
+
summary: itamae recipe for god process monitoring framework
|
123
124
|
test_files: []
|