melissadata 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +6 -6
- data/README.md +9 -16
- data/Rakefile +5 -13
- data/chef/cookbooks/melissadata/attributes/default.rb +1 -0
- data/chef/cookbooks/melissadata/recipes/default.rb +2 -2
- data/chef/cookbooks/melissadata/templates/default/md_tcp_server.init.erb +1 -1
- data/chef/cookbooks/melissadata/templates/default/md_unix_server.init.erb +1 -1
- data/lib/melissadata/melissadata.rb +16 -7
- data/lib/melissadata/vagrant_plugin/actions/install.rb +2 -2
- data/lib/melissadata/version.rb +1 -1
- data/melissadata.gemspec +6 -6
- data/pkg/melissadata-0.1.2.gem +0 -0
- metadata +49 -52
- data/templates/md_tcp_server +0 -82
- data/templates/md_unix_server +0 -81
data/Gemfile.lock
CHANGED
@@ -1,16 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
melissadata (0.1.
|
4
|
+
melissadata (0.1.2)
|
5
5
|
activesupport
|
6
|
-
awesome_print
|
7
6
|
cloudfiles
|
8
|
-
commander
|
9
|
-
i18n
|
10
7
|
msgpack-rpc
|
11
|
-
multi_json
|
12
8
|
thor
|
13
|
-
yajl-ruby
|
14
9
|
|
15
10
|
GEM
|
16
11
|
remote: http://rubygems.org/
|
@@ -102,12 +97,17 @@ PLATFORMS
|
|
102
97
|
ruby
|
103
98
|
|
104
99
|
DEPENDENCIES
|
100
|
+
awesome_print
|
101
|
+
commander
|
105
102
|
growl
|
106
103
|
guard-rspec
|
104
|
+
i18n
|
107
105
|
melissadata!
|
106
|
+
multi_json
|
108
107
|
pry
|
109
108
|
rake
|
110
109
|
rspec (> 2.4)
|
111
110
|
ruby-debug19
|
112
111
|
simplecov (>= 0.4.0)
|
113
112
|
vagrant
|
113
|
+
yajl-ruby
|
data/README.md
CHANGED
@@ -21,30 +21,23 @@ Make sure these are all installed on your development machine:
|
|
21
21
|
|
22
22
|
## Quick Start
|
23
23
|
|
24
|
-
Once all the prereqs are installed,
|
25
|
-
|
24
|
+
Once all the prereqs are installed, run these commands to get your local
|
25
|
+
environment setup:
|
26
26
|
|
27
27
|
git clone git://github.com/johnnyt/melissadata.git
|
28
28
|
cd melissadata
|
29
29
|
rake setup
|
30
30
|
|
31
|
-
Now make sure you have
|
31
|
+
Now make sure you have your MelissaData license string and a MelissaData DVD
|
32
|
+
(or .dmg) mounted (e.g. IPL-DVD-2011-Q1), and run:
|
32
33
|
|
33
|
-
rake
|
34
|
+
rake md:install
|
34
35
|
|
35
|
-
|
36
|
+
Now you should be able to fire up an IRB session `irb -r melissadata`
|
37
|
+
and run:
|
36
38
|
|
37
|
-
|
38
|
-
|
39
|
-
Once logged into the VM - run:
|
40
|
-
|
41
|
-
cd /opt/melissadata/gem
|
42
|
-
irb -r lib/md
|
43
|
-
|
44
|
-
Inside the IRB session run:
|
45
|
-
|
46
|
-
irb> ip = MelissaData::NativeObject::IpLocator.new :license => 'YOUR_LICENSE_KEY'
|
47
|
-
irb> ip.process :ip => '74.125.224.81'
|
39
|
+
irb> md = MelissaData.client
|
40
|
+
irb> md.ip '74.125.224.81'
|
48
41
|
|
49
42
|
which should return:
|
50
43
|
|
data/Rakefile
CHANGED
@@ -2,9 +2,11 @@ bundler_installed = !!(%x[gem list] =~ /^bundler/) && File.exists?('Gemfile.lock
|
|
2
2
|
|
3
3
|
desc "Setup the local environment"
|
4
4
|
task :setup do
|
5
|
-
sh %Q!gem install bundler --no-ri --no-rdoc! unless bundler_installed
|
5
|
+
sh %Q!gem install bundler --pre --no-ri --no-rdoc! unless bundler_installed
|
6
6
|
output = `bundle check 2>&1`
|
7
|
-
|
7
|
+
if $?.to_i == 0
|
8
|
+
puts "Bundler is up to date."
|
9
|
+
else
|
8
10
|
sh "bundle install"
|
9
11
|
end
|
10
12
|
|
@@ -12,17 +14,7 @@ task :setup do
|
|
12
14
|
sh "bundle exec vagrant box add lucid64 http://files.vagrantup.com/lucid64.box"
|
13
15
|
end
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
-
# puts <<-STR
|
18
|
-
|
19
|
-
|
20
|
-
# Now make sure you have a MelissaData DVD (or .dmg) mounted (e.g. IPL-DVD-2011-Q1),
|
21
|
-
# then run:
|
22
|
-
|
23
|
-
# rake md:install
|
24
|
-
|
25
|
-
# STR
|
17
|
+
sh "bundle exec vagrant up"
|
26
18
|
end
|
27
19
|
|
28
20
|
if bundler_installed
|
@@ -2,4 +2,5 @@ default[:melissadata][:paths][:root_dir] = "/opt/melissadata"
|
|
2
2
|
default[:melissadata][:paths][:config_file] = "/opt/melissadata/config.yml"
|
3
3
|
default[:melissadata][:paths][:license_file] = "/opt/melissadata/license.txt"
|
4
4
|
default[:melissadata][:paths][:log_dir] = "/var/log/melissadata"
|
5
|
+
default[:melissadata][:paths][:bin_dir] = "/opt/ruby/bin"
|
5
6
|
default[:melissadata][:runner_user] = "vagrant"
|
@@ -1,8 +1,9 @@
|
|
1
1
|
include_recipe 'ubuntu'
|
2
|
+
include_recipe 'build-essential'
|
2
3
|
|
3
4
|
package 'git-core'
|
4
5
|
|
5
|
-
%w[ rake bundler i18n thor activesupport multi_json yajl-ruby curl ].each{ |gem| gem_package gem }
|
6
|
+
%w[ rake bundler i18n thor cloudfiles activesupport multi_json yajl-ruby curl ].each{ |gem| gem_package gem }
|
6
7
|
|
7
8
|
%w[ src lib data ].each do |subdir|
|
8
9
|
directory "/opt/melissadata/#{subdir}" do
|
@@ -32,4 +33,3 @@ end
|
|
32
33
|
action :enable
|
33
34
|
end
|
34
35
|
end
|
35
|
-
|
@@ -1,11 +1,20 @@
|
|
1
|
-
|
1
|
+
root_path = File.expand_path('..', File.dirname(__FILE__))
|
2
|
+
$LOAD_PATH.unshift root_path unless $LOAD_PATH.include?(root_path)
|
2
3
|
require 'rubygems'
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
require '
|
7
|
-
require
|
8
|
-
|
4
|
+
|
5
|
+
# Development
|
6
|
+
begin
|
7
|
+
# require 'bundler'
|
8
|
+
# Bundler.require
|
9
|
+
# rescue
|
10
|
+
require 'pathname'
|
11
|
+
require 'i18n'
|
12
|
+
require 'thor'
|
13
|
+
require 'thor/group'
|
14
|
+
require 'thor/actions'
|
15
|
+
require 'cloudfiles'
|
16
|
+
# rescue
|
17
|
+
end
|
9
18
|
|
10
19
|
module MelissaData
|
11
20
|
module_function
|
@@ -45,8 +45,8 @@ module MelissaData::VagrantPlugin::Actions
|
|
45
45
|
end
|
46
46
|
|
47
47
|
sudo "chown -R vagrant:vagrant #{target_root}"
|
48
|
-
sudo "/etc/init.d/md_tcp_server
|
49
|
-
sudo "/etc/init.d/md_unix_server
|
48
|
+
sudo "/etc/init.d/md_tcp_server restart"
|
49
|
+
sudo "/etc/init.d/md_unix_server restart"
|
50
50
|
else
|
51
51
|
env.ui.error "Vagrant VM is not running", :prefix => false
|
52
52
|
end
|
data/lib/melissadata/version.rb
CHANGED
data/melissadata.gemspec
CHANGED
@@ -13,18 +13,18 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.description = s.summary
|
14
14
|
s.require_paths = %w[ lib ]
|
15
15
|
s.files = Dir["**/*"].map{ |f| f.to_s }
|
16
|
-
s.executables
|
16
|
+
s.executables = %w[ md_unix_server md_tcp_server ]
|
17
17
|
|
18
|
-
s.add_dependency 'i18n'
|
19
18
|
s.add_dependency 'thor'
|
20
19
|
s.add_dependency 'activesupport'
|
21
|
-
s.add_dependency 'multi_json'
|
22
20
|
s.add_dependency 'msgpack-rpc'
|
23
|
-
s.add_dependency 'awesome_print'
|
24
|
-
s.add_dependency 'yajl-ruby'
|
25
21
|
s.add_dependency 'cloudfiles'
|
26
|
-
s.add_dependency 'commander'
|
27
22
|
|
23
|
+
s.add_development_dependency 'i18n'
|
24
|
+
s.add_development_dependency 'multi_json'
|
25
|
+
s.add_development_dependency 'awesome_print'
|
26
|
+
s.add_development_dependency 'yajl-ruby'
|
27
|
+
s.add_development_dependency 'commander'
|
28
28
|
s.add_development_dependency 'rake'
|
29
29
|
s.add_development_dependency 'vagrant'
|
30
30
|
s.add_development_dependency 'rspec', '>2.4'
|
data/pkg/melissadata-0.1.2.gem
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: melissadata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,8 +13,8 @@ cert_chain: []
|
|
13
13
|
date: 2011-11-17 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
17
|
-
requirement: &
|
16
|
+
name: thor
|
17
|
+
requirement: &70131120435220 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *70131120435220
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
|
-
name:
|
28
|
-
requirement: &
|
27
|
+
name: activesupport
|
28
|
+
requirement: &70131120434380 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *70131120434380
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
|
-
name:
|
39
|
-
requirement: &
|
38
|
+
name: msgpack-rpc
|
39
|
+
requirement: &70131120433460 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *70131120433460
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
|
-
name:
|
50
|
-
requirement: &
|
49
|
+
name: cloudfiles
|
50
|
+
requirement: &70131120432140 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,65 +55,65 @@ dependencies:
|
|
55
55
|
version: '0'
|
56
56
|
type: :runtime
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *70131120432140
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
|
-
name:
|
61
|
-
requirement: &
|
60
|
+
name: i18n
|
61
|
+
requirement: &70131120431100 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ! '>='
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: '0'
|
67
|
-
type: :
|
67
|
+
type: :development
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *70131120431100
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
72
|
-
requirement: &
|
71
|
+
name: multi_json
|
72
|
+
requirement: &70131120430380 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ! '>='
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
|
-
type: :
|
78
|
+
type: :development
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *70131120430380
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
|
-
name:
|
83
|
-
requirement: &
|
82
|
+
name: awesome_print
|
83
|
+
requirement: &70131120429500 !ruby/object:Gem::Requirement
|
84
84
|
none: false
|
85
85
|
requirements:
|
86
86
|
- - ! '>='
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0'
|
89
|
-
type: :
|
89
|
+
type: :development
|
90
90
|
prerelease: false
|
91
|
-
version_requirements: *
|
91
|
+
version_requirements: *70131120429500
|
92
92
|
- !ruby/object:Gem::Dependency
|
93
|
-
name:
|
94
|
-
requirement: &
|
93
|
+
name: yajl-ruby
|
94
|
+
requirement: &70131120426260 !ruby/object:Gem::Requirement
|
95
95
|
none: false
|
96
96
|
requirements:
|
97
97
|
- - ! '>='
|
98
98
|
- !ruby/object:Gem::Version
|
99
99
|
version: '0'
|
100
|
-
type: :
|
100
|
+
type: :development
|
101
101
|
prerelease: false
|
102
|
-
version_requirements: *
|
102
|
+
version_requirements: *70131120426260
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: commander
|
105
|
-
requirement: &
|
105
|
+
requirement: &70131120425320 !ruby/object:Gem::Requirement
|
106
106
|
none: false
|
107
107
|
requirements:
|
108
108
|
- - ! '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
-
type: :
|
111
|
+
type: :development
|
112
112
|
prerelease: false
|
113
|
-
version_requirements: *
|
113
|
+
version_requirements: *70131120425320
|
114
114
|
- !ruby/object:Gem::Dependency
|
115
115
|
name: rake
|
116
|
-
requirement: &
|
116
|
+
requirement: &70131120423340 !ruby/object:Gem::Requirement
|
117
117
|
none: false
|
118
118
|
requirements:
|
119
119
|
- - ! '>='
|
@@ -121,10 +121,10 @@ dependencies:
|
|
121
121
|
version: '0'
|
122
122
|
type: :development
|
123
123
|
prerelease: false
|
124
|
-
version_requirements: *
|
124
|
+
version_requirements: *70131120423340
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: vagrant
|
127
|
-
requirement: &
|
127
|
+
requirement: &70131120422500 !ruby/object:Gem::Requirement
|
128
128
|
none: false
|
129
129
|
requirements:
|
130
130
|
- - ! '>='
|
@@ -132,10 +132,10 @@ dependencies:
|
|
132
132
|
version: '0'
|
133
133
|
type: :development
|
134
134
|
prerelease: false
|
135
|
-
version_requirements: *
|
135
|
+
version_requirements: *70131120422500
|
136
136
|
- !ruby/object:Gem::Dependency
|
137
137
|
name: rspec
|
138
|
-
requirement: &
|
138
|
+
requirement: &70131120421680 !ruby/object:Gem::Requirement
|
139
139
|
none: false
|
140
140
|
requirements:
|
141
141
|
- - ! '>'
|
@@ -143,10 +143,10 @@ dependencies:
|
|
143
143
|
version: '2.4'
|
144
144
|
type: :development
|
145
145
|
prerelease: false
|
146
|
-
version_requirements: *
|
146
|
+
version_requirements: *70131120421680
|
147
147
|
- !ruby/object:Gem::Dependency
|
148
148
|
name: growl
|
149
|
-
requirement: &
|
149
|
+
requirement: &70131120420900 !ruby/object:Gem::Requirement
|
150
150
|
none: false
|
151
151
|
requirements:
|
152
152
|
- - ! '>='
|
@@ -154,10 +154,10 @@ dependencies:
|
|
154
154
|
version: '0'
|
155
155
|
type: :development
|
156
156
|
prerelease: false
|
157
|
-
version_requirements: *
|
157
|
+
version_requirements: *70131120420900
|
158
158
|
- !ruby/object:Gem::Dependency
|
159
159
|
name: guard-rspec
|
160
|
-
requirement: &
|
160
|
+
requirement: &70131120420060 !ruby/object:Gem::Requirement
|
161
161
|
none: false
|
162
162
|
requirements:
|
163
163
|
- - ! '>='
|
@@ -165,10 +165,10 @@ dependencies:
|
|
165
165
|
version: '0'
|
166
166
|
type: :development
|
167
167
|
prerelease: false
|
168
|
-
version_requirements: *
|
168
|
+
version_requirements: *70131120420060
|
169
169
|
- !ruby/object:Gem::Dependency
|
170
170
|
name: pry
|
171
|
-
requirement: &
|
171
|
+
requirement: &70131120419040 !ruby/object:Gem::Requirement
|
172
172
|
none: false
|
173
173
|
requirements:
|
174
174
|
- - ! '>='
|
@@ -176,10 +176,10 @@ dependencies:
|
|
176
176
|
version: '0'
|
177
177
|
type: :development
|
178
178
|
prerelease: false
|
179
|
-
version_requirements: *
|
179
|
+
version_requirements: *70131120419040
|
180
180
|
- !ruby/object:Gem::Dependency
|
181
181
|
name: ruby-debug19
|
182
|
-
requirement: &
|
182
|
+
requirement: &70131120406900 !ruby/object:Gem::Requirement
|
183
183
|
none: false
|
184
184
|
requirements:
|
185
185
|
- - ! '>='
|
@@ -187,10 +187,10 @@ dependencies:
|
|
187
187
|
version: '0'
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
|
-
version_requirements: *
|
190
|
+
version_requirements: *70131120406900
|
191
191
|
- !ruby/object:Gem::Dependency
|
192
192
|
name: simplecov
|
193
|
-
requirement: &
|
193
|
+
requirement: &70131120405840 !ruby/object:Gem::Requirement
|
194
194
|
none: false
|
195
195
|
requirements:
|
196
196
|
- - ! '>='
|
@@ -198,15 +198,14 @@ dependencies:
|
|
198
198
|
version: 0.4.0
|
199
199
|
type: :development
|
200
200
|
prerelease: false
|
201
|
-
version_requirements: *
|
201
|
+
version_requirements: *70131120405840
|
202
202
|
description: Ruby wrappers around MelissaData objects
|
203
203
|
email:
|
204
204
|
- johnnyt@xan.do
|
205
205
|
- cwyckoff@alliancehealth.com
|
206
206
|
executables:
|
207
|
-
- md_tcp_server
|
208
207
|
- md_unix_server
|
209
|
-
-
|
208
|
+
- md_tcp_server
|
210
209
|
extensions: []
|
211
210
|
extra_rdoc_files: []
|
212
211
|
files:
|
@@ -297,8 +296,6 @@ files:
|
|
297
296
|
- spec/melissadata/vagrant_plugin/actions/install_spec.rb
|
298
297
|
- spec/melissadata/vagrant_plugin/config_spec.rb
|
299
298
|
- spec/spec_helper.rb
|
300
|
-
- templates/md_tcp_server
|
301
|
-
- templates/md_unix_server
|
302
299
|
- Vagrantfile
|
303
300
|
homepage: http://github.com/johnnyt/melissadata
|
304
301
|
licenses: []
|
data/templates/md_tcp_server
DELETED
@@ -1,82 +0,0 @@
|
|
1
|
-
#! /bin/sh
|
2
|
-
|
3
|
-
### BEGIN INIT INFO
|
4
|
-
# Provides: md_tcp_server
|
5
|
-
# Required-Start: $all
|
6
|
-
# Required-Stop: $all
|
7
|
-
# Default-Start: 2 3 4 5
|
8
|
-
# Default-Stop: 0 1 6
|
9
|
-
# Short-Description: Starts the MelissaData TCP server
|
10
|
-
# Description: Starts the MelissaData TCP server
|
11
|
-
### END INIT INFO
|
12
|
-
|
13
|
-
NAME=md_tcp_server
|
14
|
-
SCRIPTNAME=/etc/init.d/$NAME
|
15
|
-
DAEMON=/usr/bin/$NAME
|
16
|
-
PID_FILE=/var/run/$NAME.pid
|
17
|
-
RUNASUSER=vagrant
|
18
|
-
ARGS=""
|
19
|
-
|
20
|
-
# Define LSB log_* functions.
|
21
|
-
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
|
22
|
-
. /lib/lsb/init-functions
|
23
|
-
|
24
|
-
# Function that starts the daemon/service
|
25
|
-
do_start() {
|
26
|
-
start-stop-daemon \
|
27
|
-
--start --background \
|
28
|
-
--make-pidfile --pidfile $PID_FILE \
|
29
|
-
--chuid $RUNASUSER \
|
30
|
-
--exec $DAEMON -- $ARGS || true
|
31
|
-
}
|
32
|
-
|
33
|
-
# Function that stops the daemon/service
|
34
|
-
do_stop() {
|
35
|
-
start-stop-daemon --stop --pidfile $PID_FILE
|
36
|
-
}
|
37
|
-
|
38
|
-
case "$1" in
|
39
|
-
start)
|
40
|
-
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $NAME"
|
41
|
-
do_start
|
42
|
-
case "$?" in
|
43
|
-
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
44
|
-
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
45
|
-
esac
|
46
|
-
;;
|
47
|
-
stop)
|
48
|
-
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $NAME"
|
49
|
-
do_stop
|
50
|
-
case "$?" in
|
51
|
-
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
52
|
-
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
53
|
-
esac
|
54
|
-
;;
|
55
|
-
|
56
|
-
restart)
|
57
|
-
do_stop
|
58
|
-
case "$?" in
|
59
|
-
0|1)
|
60
|
-
do_start
|
61
|
-
case "$?" in
|
62
|
-
0) log_end_msg 0 ;;
|
63
|
-
1) log_end_msg 1 ;; # Old process is still running
|
64
|
-
*) log_end_msg 1 ;; # Failed to start
|
65
|
-
esac
|
66
|
-
;;
|
67
|
-
|
68
|
-
*)
|
69
|
-
# Failed to stop
|
70
|
-
log_end_msg 1
|
71
|
-
;;
|
72
|
-
esac
|
73
|
-
;;
|
74
|
-
|
75
|
-
*)
|
76
|
-
log_action_msg "Usage: $SCRIPTNAME {start|stop|restart}" >&2
|
77
|
-
exit 3
|
78
|
-
;;
|
79
|
-
esac
|
80
|
-
|
81
|
-
exit 0
|
82
|
-
|
data/templates/md_unix_server
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
#! /bin/sh
|
2
|
-
|
3
|
-
### BEGIN INIT INFO
|
4
|
-
# Provides: md_unix_server
|
5
|
-
# Required-Start: $all
|
6
|
-
# Required-Stop: $all
|
7
|
-
# Default-Start: 2 3 4 5
|
8
|
-
# Default-Stop: 0 1 6
|
9
|
-
# Short-Description: Starts the MelissaData UnixSocket server
|
10
|
-
# Description: Starts the MelissaData UnixSocket server
|
11
|
-
### END INIT INFO
|
12
|
-
|
13
|
-
NAME=md_unix_server
|
14
|
-
SCRIPTNAME=/etc/init.d/$NAME
|
15
|
-
DAEMON=/usr/bin/$NAME
|
16
|
-
PID_FILE=/var/run/$NAME.pid
|
17
|
-
RUNASUSER=vagrant
|
18
|
-
ARGS=""
|
19
|
-
|
20
|
-
# Define LSB log_* functions.
|
21
|
-
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
|
22
|
-
. /lib/lsb/init-functions
|
23
|
-
|
24
|
-
# Function that starts the daemon/service
|
25
|
-
do_start() {
|
26
|
-
start-stop-daemon \
|
27
|
-
--start --background \
|
28
|
-
--make-pidfile --pidfile $PID_FILE \
|
29
|
-
--chuid $RUNASUSER \
|
30
|
-
--exec $DAEMON -- $ARGS || true
|
31
|
-
}
|
32
|
-
|
33
|
-
# Function that stops the daemon/service
|
34
|
-
do_stop() {
|
35
|
-
start-stop-daemon --stop --pidfile $PID_FILE
|
36
|
-
}
|
37
|
-
|
38
|
-
case "$1" in
|
39
|
-
start)
|
40
|
-
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $NAME"
|
41
|
-
do_start
|
42
|
-
case "$?" in
|
43
|
-
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
44
|
-
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
45
|
-
esac
|
46
|
-
;;
|
47
|
-
stop)
|
48
|
-
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $NAME"
|
49
|
-
do_stop
|
50
|
-
case "$?" in
|
51
|
-
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
52
|
-
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
53
|
-
esac
|
54
|
-
;;
|
55
|
-
|
56
|
-
restart)
|
57
|
-
do_stop
|
58
|
-
case "$?" in
|
59
|
-
0|1)
|
60
|
-
do_start
|
61
|
-
case "$?" in
|
62
|
-
0) log_end_msg 0 ;;
|
63
|
-
1) log_end_msg 1 ;; # Old process is still running
|
64
|
-
*) log_end_msg 1 ;; # Failed to start
|
65
|
-
esac
|
66
|
-
;;
|
67
|
-
|
68
|
-
*)
|
69
|
-
# Failed to stop
|
70
|
-
log_end_msg 1
|
71
|
-
;;
|
72
|
-
esac
|
73
|
-
;;
|
74
|
-
|
75
|
-
*)
|
76
|
-
log_action_msg "Usage: $SCRIPTNAME {start|stop|restart}" >&2
|
77
|
-
exit 3
|
78
|
-
;;
|
79
|
-
esac
|
80
|
-
|
81
|
-
exit 0
|