Class: OsCtld::DistConfig::Distributions::Debian

Inherits:
Base
  • Object
show all
Defined in:
lib/osctld/dist_config/distributions/debian.rb

Direct Known Subclasses

Alpine, Devuan, Ubuntu

Defined Under Namespace

Classes: Configurator

Instance Attribute Summary

Attributes inherited from Base

#configurator, #ct, #ctrc, #distribution, #version

Instance Method Summary collapse

Methods inherited from Base

#add_netif, #bin_path, #configurator_class, distribution, #dns_resolvers, #initialize, #log_type, #network, #passwd, #post_mount, #pre_start, #remove_netif, #rename_netif, #set_hostname, #start, #stop, #unset_etc_hosts, #update_etc_hosts, #volatile_is_systemd?, #with_rootfs

Methods included from Utils::SwitchUser

#ct_attach, #ct_syscmd

Constructor Details

This class inherits a constructor from OsCtld::DistConfig::Distributions::Base

Instance Method Details

#apply_hostnameObject



22
23
24
25
26
27
28
29
# File 'lib/osctld/dist_config/distributions/debian.rb', line 22

def apply_hostname
  begin
    ct_syscmd(ct, %w(hostname -F /etc/hostname))

  rescue SystemCommandFailed => e
    log(:warn, ct, "Unable to apply hostname: #{e.message}")
  end
end