itamae-plugin-recipe-god 0.2.4 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1b70fe8e84fc466697e182390318c5401c0091aef1cc25b2a3fd83ddbaaf9bc
4
- data.tar.gz: a7ed4454a7885d23f7952a5a13972acb006313529988f8daf7a91d0c690e2c5b
3
+ metadata.gz: 716b3821246e52badde793a0eadc31195cb8b7a9d288dea5bae3fbcdc51ec703
4
+ data.tar.gz: e72017bc1a11fdb4cca9a0ec4ddad24c38eb906a0f2b97cf749a4c1153428041
5
5
  SHA512:
6
- metadata.gz: a34d4c8b837f40d647a1e65f1fe4a2204445879aafc444b5c3884b39868eda5653c27c221902b860ad2625f82232282a03f7b196a6ae8188303222371384993a
7
- data.tar.gz: cedce7b9ed154c8a251b2cc3f631528f5f5966183922f0f0063213c8109c9d4a4ac580c939c414013b3fcf3407a70213b7113dac00ef8fa9b0214f6e9f07e2be
6
+ metadata.gz: a464da26f5438f3b7567d96c2dc743a7e14ccbbdb098fbb9cadc0308b6481f78eca19d79159f544e285941f7b147a5eed7165fe205dfc7eee2f8e81ef07b6399
7
+ data.tar.gz: 7cb047ad676d1689910be2594bbf489e020e28dd3f2f35d857850ea2693961572a1886788fc8b41d20799ac28b1f69ed5068fa04dd8116111bfa5c72339734c9
@@ -40,7 +40,9 @@ template '/etc/god/master.conf' do
40
40
  mode '644'
41
41
  end
42
42
 
43
+ ruby_bin_dir = node.languages.ruby.bin_dir rescue nil
43
44
  service_variables = {
45
+ god_bin: (ruby_bin_dir ? "#{ruby_bin_dir}/god" : 'god'),
44
46
  pid: '/var/run/god.pid',
45
47
  config: '/etc/god/master.conf',
46
48
  log: '/var/log/god.log',
@@ -8,6 +8,7 @@
8
8
 
9
9
  . /etc/rc.d/init.d/functions
10
10
 
11
+ GOD_BIN=<%= @god_bin %>
11
12
  PID=<%= @pid %>
12
13
  CONFIG=<%= @config %>
13
14
  LOG=<%= @log %>
@@ -17,27 +18,27 @@ RETVAL=0
17
18
  case "$1" in
18
19
  start)
19
20
  echo -n 'Starting god: '
20
- god -P $PID -c $CONFIG -l $LOG --log-level <%= @log_level %>
21
+ $GOD_BIN -P $PID -c $CONFIG -l $LOG --log-level <%= @log_level %>
21
22
  echo
22
23
  RETVAL=$?
23
24
  ;;
24
25
  stop)
25
26
  echo -n 'Stopping god: '
26
- god quit
27
+ $GOD_BIN quit
27
28
  echo
28
29
  RETVAL=$?
29
30
  ;;
30
31
  restart)
31
32
  echo -n 'Stopping god: '
32
- god quit
33
+ $GOD_BIN quit
33
34
  echo
34
35
  echo -n 'Starting god: '
35
- god -P $PID -c $CONFIG -l $LOG --log-level <%= @log_level %>
36
+ $GOD_BIN -P $PID -c $CONFIG -l $LOG --log-level <%= @log_level %>
36
37
  echo
37
38
  RETVAL=$?
38
39
  ;;
39
40
  status)
40
- god status
41
+ $GOD_BIN status
41
42
  RETVAL=$?
42
43
  ;;
43
44
  *)
@@ -3,10 +3,14 @@ Description=God: A process monitoring framework in Ruby
3
3
  After=network.target
4
4
 
5
5
  [Service]
6
+ Environment="CONF_FILE=<%= @config %>"
7
+ Environment="PID_FILE=<%= @pid %>"
8
+ Environment="LOG_FILE=<%= @log %>"
9
+ Environment="LOG_LEVEL=<%= @log_level %>"
6
10
  EnvironmentFile=-/etc/sysconfig/god
7
- PIDFile=<%= @pid %>
8
- ExecStart=<%= `which god`.chomp %> -c <%= @config %> -P <%= @pid %> -l <%= @log %> --log-level <%= @log_level %>
9
- ExecStop=<%= `which god`.chomp %> quit
11
+ PIDFile=$PID_FILE
12
+ ExecStart=<%= @god_bin %> -c $CONF_FILE -P $PID_FILE -l $LOG_FILE --log-level $LOG_LEVEL
13
+ ExecStop=<%= @god_bin %> quit
10
14
 
11
15
  [Install]
12
16
  WantedBy=multi-user.target
@@ -2,7 +2,7 @@ module Itamae
2
2
  module Plugin
3
3
  module Recipe
4
4
  module God
5
- VERSION = '0.2.4'
5
+ VERSION = '0.2.6'
6
6
  end
7
7
  end
8
8
  end
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.2.4
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - y-matsuda
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-11 00:00:00.000000000 Z
11
+ date: 2024-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: itamae