Sha256: 9e88b2eaf3df718c4cfbc0832e4641aa713dd254ae5806e2d7fa2415bdfe0f7b

Contents?: true

Size: 841 Bytes

Versions: 2

Compression:

Stored size: 841 Bytes

Contents

# frozen_string_literal: true

# takelage docker socket start
module DockerSocketStart
  # Backend method for docker socket start.
  def docker_socket_start
    log.debug 'Starting sockets for docker container'

    return false unless docker_check_daemon

    return false unless command_available? 'socat'

    cmds_start_socket = _docker_socket_lib_get_socket_start_commands 'start'

    return true if cmds_start_socket.empty?

    _docker_socket_start_get_sudo

    cmds_start_socket.each do |cmd_start_socket|
      run_and_fork cmd_start_socket
    end

    true
  end

  private

  # Get sudo.
  def _docker_socket_start_get_sudo
    log.debug 'Request sudo so that ' \
      'subsequent background tasks run without delay'
    cmd_sudo_true =
      config.active['cmd_docker_socket_start_sudo_true']
    run cmd_sudo_true
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
takelage-0.28.26 lib/takelage/docker/socket/start.rb
takelage-0.28.24 lib/takelage/docker/socket/start.rb