pleaserun 0.0.10 → 0.0.11
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 +4 -4
- data/lib/pleaserun/platform/base.rb +12 -0
- data/pleaserun.gemspec +1 -1
- data/spec/pleaserun/platform/base_spec.rb +26 -0
- data/templates/sysv/lsb-3.1/init.sh +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 7e50e060860038237de312754205fa8496da9f9e
         | 
| 4 | 
            +
              data.tar.gz: 08df6e23c1667e27ccd137bfb4736130b9a02ffb
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 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
    
    
| @@ -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 | 
            -
              " >  | 
| 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. | 
| 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- | 
| 11 | 
            +
            date: 2015-03-03 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: cabin
         |