Class: Foreman::Export::Runit

### Home Classes Methods

### In Files

- lib/foreman/export/runit.rb

### Parent

Foreman::Export::Base

### Methods

- #export

### Class/Module Index

Quicksearch

- Foreman
- Foreman::AppDoesNotExist
- Foreman::CLI
- Foreman::Distribution
- Foreman::Engine
- Foreman::Engine::CLI
- Foreman::Engine::CLI::Color
- Foreman::Export
- Foreman::Export::Base
- Foreman::Export::Bluepill
- Foreman::Export::Exception
- Foreman::Export::Inittab
- Foreman::Export::Launchd
- Foreman::Export::Runit
- Foreman::Export::Supervisord
- Foreman::Export::Upstart
- Foreman::Helpers
- Foreman::Process
- Foreman::Procfile

No matching classes.

# Foreman::Export::Runit

### Constants

ENV_VARIABLE_REGEX

### Public Instance Methods

export() click to toggle source

    # File lib/foreman/export/runit.rb, line 8
    def export
      super

      engine.each_process do |name, process|
        1.upto(engine.formation[name]) do |num|
          process_directory = "#{app}-#{name}-#{num}"

          create_directory process_directory
          create_directory "#{process_directory}/env"
          create_directory "#{process_directory}/log"

          write_template "runit/run.erb", "#{process_directory}/run", binding
          chmod 0755, "#{process_directory}/run"

          port = engine.port_for(process, num)
          engine.env.merge("PORT" => port.to_s).each do |key, value|
            write_file "#{process_directory}/env/#{key}", value
          end

          write_template "runit/log/run.erb", "#{process_directory}/log/run", binding
          chmod 0755, "#{process_directory}/log/run"
        end
      end

    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.