pleaserun 0.0.10 → 0.0.11

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
  SHA1:
3
- metadata.gz: 79e4406ef60541b06355384567e5996f601ba3f1
4
- data.tar.gz: 2a7229543b510dc11eebddaa57c9bb4086d4ee26
3
+ metadata.gz: 7e50e060860038237de312754205fa8496da9f9e
4
+ data.tar.gz: 08df6e23c1667e27ccd137bfb4736130b9a02ffb
5
5
  SHA512:
6
- metadata.gz: 2e108a2241aae8a69ad9f39ac3cc5ebfcc583f3682f5af46a813c290e8841ac16a23442c46d0580fd056342b7b03023aef11a4966d1f74eb28fe781d748174b3
7
- data.tar.gz: b95b589a5d70a618aceb1f1318e3a02c4957a7818311fd8b6a64673ba078959bf39200f9f80d691b276bf9486063f2d75c1b232f1cb5a6321e344068b8732fd2
6
+ metadata.gz: b10ac793a4e4d2811942ffffe229f058cd2055cfd92adae69b336662d6fbd856e31e98b9c4289a3215fb91ff979a5c42d72ccfdfc4bda951ca0583d97e7007d6
7
+ data.tar.gz: 971a24a661d868ec6d750a13fc6c70bcc08ec74f07e39112245547ea220f270230974e25f325996c734c262fe5528f51faa0b8e8887aff86945bc54ba36ed4eb
@@ -130,6 +130,10 @@ class PleaseRun::Platform::Base
130
130
  validate { |v| v == "ulimited" || v.to_i > 0 }
131
131
  end
132
132
 
133
+ # TODO(sissel): Move this into the sysv platform
134
+ attribute :sysv_log_path, "The destination for log output. If ending with a trailing / is treated like a directory with path/<name>.log. This setting only currently works with the sysv platform. This flag may go away at any time because I'm not sure we can easily abstract the logging feature across different service managers. Upstart and systemd don't even have this concept.",
135
+ :default => "/var/log/"
136
+
133
137
 
134
138
  attribute :prestart, "A command to execute before starting and restarting. A failure of this command will cause the start/restart to abort. This is useful for health checks, config tests, or similar operations."
135
139
 
@@ -186,4 +190,12 @@ class PleaseRun::Platform::Base
186
190
  def install_actions
187
191
  return []
188
192
  end # def install_actions
193
+
194
+ def sysv_log
195
+ if sysv_log_path.end_with?("/")
196
+ File.join(sysv_log_path, name)
197
+ else
198
+ sysv_log_path
199
+ end
200
+ end
189
201
  end # class PleaseRun::Base
data/pleaserun.gemspec CHANGED
@@ -2,7 +2,7 @@ Gem::Specification.new do |spec|
2
2
  files = `git ls-files`.split("\n")
3
3
 
4
4
  spec.name = "pleaserun"
5
- spec.version = "0.0.10"
5
+ spec.version = "0.0.11"
6
6
  spec.summary = "pleaserun"
7
7
  spec.description = "pleaserun"
8
8
  spec.license = "Apache 2.0"
@@ -24,5 +24,31 @@ describe PleaseRun::Platform::Base do
24
24
  it "#group should be root" do
25
25
  insist { subject.group } == "root"
26
26
  end
27
+
28
+ context "#sysv_log" do
29
+ let(:name) { "fancy" }
30
+ before { subject.name = name }
31
+
32
+ context "default" do
33
+ it "should be in /var/log" do
34
+ expect(subject.sysv_log).to(be == "/var/log/#{name}")
35
+ end
36
+ end
37
+
38
+ context "when given a directory" do
39
+ let(:path) { "/tmp/" }
40
+ before { subject.sysv_log_path = path }
41
+ it "should be <path>/<name>" do
42
+ expect(subject.sysv_log).to(be == File.join(path, subject.name))
43
+ end
44
+ end
45
+ context "when given a path" do
46
+ let(:path) { "/some/path" }
47
+ before { subject.sysv_log_path = path }
48
+ it "should be exactly the path given" do
49
+ expect(subject.sysv_log).to(be == path)
50
+ end
51
+ end
52
+ end
27
53
  end
28
54
  end
@@ -57,7 +57,7 @@ start() {
57
57
  {{{ulimit_shell}}}
58
58
  cd \"$chdir\"
59
59
  exec \"$program\" $args
60
- " > /var/log/$name.log 2> /var/log/$name.err &
60
+ " > {{{ sysv_log }}}.log 2> {{{ sysv_log }}}.err &
61
61
 
62
62
  # Generate the pidfile from here. If we instead made the forked process
63
63
  # generate it there will be a race condition between the pidfile writing
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pleaserun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Sissel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-01 00:00:00.000000000 Z
11
+ date: 2015-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cabin