luban-mysql 0.1.6 → 0.1.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45fedade9c024a0d09b28909dd49d451d8b06a58
4
- data.tar.gz: d671e255d113b718c28074aa4959a30383dfcdcf
3
+ metadata.gz: 415796f7559d2dcdf93da2fccd32fcdc3ff132ba
4
+ data.tar.gz: 272a879c840e8517401ae835d0a9bd5afe534804
5
5
  SHA512:
6
- metadata.gz: 7956bbeb4054021bcaf4c0cac25fa571b374af98030514137805a8736287484b8bcfc45b69ac42d6c71dcb642808f830db012cd9fa9a0272fda31a1f9cdf2d88
7
- data.tar.gz: 93f7d008517201575038a585fbfde4ca4b1379eab92c41d7382308acb48a42434f40b0ee47e831c5e1733ff198a2a6ed6b583596c1e127e8e34578faee1ca489
6
+ metadata.gz: 7d8027a3b7008e697defcbd0d3042897f7ae01bcd9f7ce98a8c358fcd03e5ac0e4edb69eca15a5d911f33df63231f63faf4929c20a636b326dac81f8c1a5d8ae
7
+ data.tar.gz: de527993572108a087c7122f53a30161eac0a93da9a39af2af8b4bca0c4ffe7017ccc057440a9ae1c5c5817c28b25607e7c7575906edea1637b0c8ddbd2b75f1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change log
2
2
 
3
+ ## Version 0.1.7 (Sept 19, 2016)
4
+
5
+ Minor enhancements:
6
+ * Refactored the way of composing shell commands
7
+ * As a result, bumped up the gem dependency on Luban to version 0.8.0
8
+
3
9
  ## Version 0.1.6 (Aug 05, 2016)
4
10
 
5
11
  Bug fixes:
@@ -10,6 +10,10 @@ module Luban
10
10
  base.define_executable 'mysqld'
11
11
  end
12
12
 
13
+ def shell_setup
14
+ @shell_setup ||= super << "cd #{install_path}"
15
+ end
16
+
13
17
  def mysqld_safe_command
14
18
  @mysqld_safe_command ||= "#{mysqld_safe_executable} --defaults-file=#{control_file_path}"
15
19
  end
@@ -22,14 +26,12 @@ module Luban
22
26
  @process_pattern ||= "^#{mysqld_executable} --defaults-file=#{control_file_path}"
23
27
  end
24
28
 
25
- alias_method :start_command, :mysqld_safe_command
26
-
27
29
  def start_command
28
- @start_command ||= "#{mysqld_safe_command}"
30
+ @start_command ||= shell_command("#{mysqld_safe_command}", output: nil) + ' &'
29
31
  end
30
32
 
31
33
  def stop_command
32
- @stop_command ||= "kill $(cat #{pid_file_path} 2>/dev/null)"
34
+ @stop_command ||= shell_command("kill $(cat #{pid_file_path} 2>/dev/null)")
33
35
  end
34
36
 
35
37
  def ping_command
@@ -58,12 +60,6 @@ module Luban
58
60
 
59
61
  protected
60
62
 
61
- def start_process!
62
- within install_path do
63
- capture(:nohup, "#{start_command} >/dev/null 2>&1 &")
64
- end
65
- end
66
-
67
63
  def reload_process!
68
64
  capture("kill -HUP $(cat #{pid_file_path} 2>/dev/null) 2>&1")
69
65
  end
@@ -3,7 +3,7 @@
3
3
  check process <%= service_entry %>
4
4
  with pidfile <%= pid_file_path %>
5
5
  onreboot laststate
6
- start program = "/bin/bash -c 'sleep 1; cd <%= install_path %>; <%= start_command %> >/dev/null 2>&1 &'"
6
+ start program = "/bin/bash -c 'sleep 1; <%= start_command %>'"
7
7
  stop program = "/bin/bash -c '<%= stop_command %>'"
8
8
  if totalmem is greater than 150.0 MB for 40 cycles then alert
9
9
  if failed port 3306 for 4 times within 8 cycles then restart
@@ -2,7 +2,7 @@ module Luban
2
2
  module Deployment
3
3
  module Packages
4
4
  class Mysql
5
- VERSION = '0.1.6'
5
+ VERSION = '0.1.7'
6
6
  end
7
7
  end
8
8
  end
data/luban-mysql.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.required_ruby_version = ">= 2.1.0"
23
- spec.add_dependency 'luban', ">= 0.6.8"
23
+ spec.add_dependency 'luban', ">= 0.8.0"
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 1.11"
26
26
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luban-mysql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rubyist Chi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-05 00:00:00.000000000 Z
11
+ date: 2016-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: luban
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.6.8
19
+ version: 0.8.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.6.8
26
+ version: 0.8.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement