X7ROOT File Manager
Current Path:
/usr/lib/pcsd
usr
/
lib
/
pcsd
/
📁
..
📁
.bundle
📄
Gemfile
(223 B)
📄
Gemfile.lock
(731 B)
📄
Makefile
(1.17 KB)
📄
auth.rb
(4.78 KB)
📄
bootstrap.rb
(3.57 KB)
📄
capabilities.xml
(59.05 KB)
📄
cfgsync.rb
(23.66 KB)
📄
cluster.rb
(413 B)
📄
cluster_entity.rb
(29.81 KB)
📄
config.rb
(6.49 KB)
📄
config.ru
(440 B)
📄
corosyncconf.rb
(3.78 KB)
📄
fenceagent.rb
(1.16 KB)
📄
pcs.rb
(61.88 KB)
📄
pcsd
(695 B)
📄
pcsd-cli.rb
(4.37 KB)
📄
pcsd.8
(3.19 KB)
📄
pcsd.logrotate
(151 B)
📄
pcsd.pam
(154 B)
📄
pcsd.rb
(49.65 KB)
📄
pcsd_action_command.rb
(2.11 KB)
📄
pcsd_exchange_format.rb
(1.35 KB)
📄
pcsd_file.rb
(3.95 KB)
📄
pcsd_remove_file.rb
(595 B)
📄
permissions.rb
(4.24 KB)
📁
public
📄
remote.rb
(94.31 KB)
📄
resource.rb
(12.63 KB)
📄
rfc7919-ffdhe2048.pem
(424 B)
📄
session.rb
(2.01 KB)
📄
settings.rb
(1.15 KB)
📄
ssl.rb
(7.27 KB)
📁
vendor
📁
views
📄
wizard.rb
(418 B)
📁
wizards
Editing: bootstrap.rb
require 'digest/sha2' require 'logger' require 'open4' require 'pathname' require 'settings.rb' def is_rhel6() # Checking corosync version works in most cases and supports non-rhel # distributions as well as running (manually compiled) corosync2 on rhel6. # - corosync2 does not support cman at all # - corosync1 runs with cman on rhel6 # - corosync1 can be used without cman, but we don't support it anyways # - corosync2 is the default result if errors occur out = '' status = Open4::popen4(COROSYNC, '-v') { |pid, stdin, stdout, stderr| out = stdout.readlines() } retval = status.exitstatus return false if retval != 0 match = /version\D+(\d+)/.match(out.join()) return (match and match[1] == "1") end def is_systemctl() systemctl_paths = [ '/run/systemd/system', '/var/run/systemd/system', ] systemctl_paths.each { |path| return true if File.directory?(path) } return false end def get_pcsd_path() return Pathname.new( File.expand_path(File.dirname(__FILE__)) ).realpath end def get_pcs_path() pcsd_path = get_pcsd_path().to_s if PCSD_EXEC_LOCATION == pcsd_path or PCSD_EXEC_LOCATION == (pcsd_path + '/') return PCS_EXEC else return pcsd_path + '/../pcs/pcs' end end PCS_VERSION = '0.9.169' # unique instance signature, allows detection of dameon restarts DAEMON_INSTANCE_SIGNATURE = Digest::SHA2.hexdigest("#{Time.now} #{rand()}") COROSYNC = COROSYNC_BINARIES + "corosync" ISRHEL6 = is_rhel6 ISSYSTEMCTL = is_systemctl if ISRHEL6 COROSYNC_CMAPCTL = COROSYNC_BINARIES + "corosync-objctl" else COROSYNC_CMAPCTL = COROSYNC_BINARIES + "corosync-cmapctl" end COROSYNC_QUORUMTOOL = COROSYNC_BINARIES + "corosync-quorumtool" if not defined? $cur_node_name $cur_node_name = `/bin/hostname`.chomp end def configure_logger(log_device) # Open the file ourselves so we can set its permissions for the case the file # does not exist. Logger is able to create and open the file for us but it # does not allow specifying file permissions. if log_device.is_a?(String) # File.open(path, mode, options) # File.open(path, mode, perm, options) # In order to set permissions, the method must be called with 4 arguments. log_device = File.open(log_device, "a+", 0600, {}) log_device.sync = true end logger = Logger.new(log_device) if ENV['PCSD_DEBUG'] and ENV['PCSD_DEBUG'].downcase == "true" then logger.level = Logger::DEBUG logger.info "PCSD Debugging enabled" else logger.level = Logger::INFO end if ISRHEL6 logger.debug "Detected RHEL 6" else logger.debug "Did not detect RHEL 6" end if ISSYSTEMCTL logger.debug "Detected systemd is in use" else logger.debug "Detected systemd is not in use" end return logger end def get_capabilities(logger) capabilities = [] capabilities_pcsd = [] begin filename = (get_pcsd_path() + Pathname.new('capabilities.xml')).to_s capabilities_xml = REXML::Document.new(File.new(filename)) capabilities_xml.elements.each('.//capability') { |feat_xml| feat = {} feat_xml.attributes.each() { |name, value| feat[name] = value } feat['description'] = '' if feat_xml.elements['description'] feat['description'] = feat_xml.elements['description'].text.strip end capabilities << feat } capabilities.each { |feat| if feat['in-pcsd'] == '1' capabilities_pcsd << feat['id'] end } rescue => e logger.error( "Cannot read capabilities definition file '#{filename}': '#{e}'" ) return [], [] end return capabilities, capabilities_pcsd end
Upload File
Create Folder