Class: SpecInfra::Command::Fedora

Inherits:
RedHat show all
Defined in:
lib/specinfra/command/fedora.rb

Instance Method Summary collapse

Methods inherited from RedHat

#check_access_by_user, #check_installed, #check_yumrepo, #check_yumrepo_enabled, #get_package_version, #install

Methods inherited from Linux

#check_access_by_user, #check_container, #check_container_running, #check_iptables_rule, #check_ipv4_address, #check_kernel_module_loaded, #check_selinux, #check_zfs, #get_interface_speed_of

Methods inherited from Base

#check_access_by_user, #check_authorized_key, #check_belonging_group, #check_container, #check_cotainer_running, #check_cron_entry, #check_directory, #check_file, #check_file_checksum, #check_file_contain, #check_file_contain_lines, #check_file_contain_with_fixed_strings, #check_file_contain_with_regexp, #check_file_contain_within, #check_file_md5checksum, #check_file_sha256checksum, #check_gid, #check_group, #check_grouped, #check_home_directory, #check_installed, #check_installed_by_cpan, #check_installed_by_gem, #check_installed_by_npm, #check_installed_by_pear, #check_installed_by_pecl, #check_installed_by_pip, #check_ipfilter_rule, #check_ipnat_rule, #check_iptables_rule, #check_ipv4_address, #check_kernel_module_loaded, #check_link, #check_listening, #check_listening_with_protocol, #check_login_shell, #check_mail_alias, #check_mode, #check_monitored_by_god, #check_monitored_by_monit, #check_mounted, #check_owner, #check_process, #check_reachable, #check_resolvable, #check_routing_table, #check_running_under_supervisor, #check_running_under_upstart, #check_selinux, #check_service_installed, #check_service_start_mode, #check_socket, #check_svcprop, #check_svcprops, #check_uid, #check_user, #check_yumrepo, #check_yumrepo_enabled, #check_zfs, #escape, #get_file_content, #get_ipaddress_of_host, #get_mode, #get_package_version, #get_process

Instance Method Details

#check_enabled(service, target = "multi-user.target") ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/specinfra/command/fedora.rb', line 4

def check_enabled(service, target="multi-user.target")
  host = SpecInfra.configuration.ssh ? SpecInfra.configuration.ssh.host : 'localhost'
  if property.has_key?(:os_by_host) && property[:os_by_host][host][:release].to_i < 15
    super
  else
    # Fedora 15+ uses systemd which no longer has runlevels but targets
    # For backwards compatibility, Fedora provides pseudo targets for
    # runlevels
    if target.is_a? Integer
      target = "runlevel#{target}.target"
    end
    "systemctl --plain list-dependencies #{target} | grep '^#{escape(service)}.service$'"
  end
end

#check_running(service) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/specinfra/command/fedora.rb', line 19

def check_running(service)
  host = SpecInfra.configuration.ssh ? SpecInfra.configuration.ssh.host : 'localhost'
  if property.has_key?(:os_by_host) && property[:os_by_host][host][:release].to_i < 15
    super
  else
    "systemctl is-active #{escape(service)}.service"
  end
end