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: pcsd_action_command.rb
require 'pcsd_exchange_format.rb' require 'settings.rb' require 'pcs.rb' #(enable|disable|start|stop)_service, module PcsdActionCommand class ActionType def initialize(id, action) @id = id @action = action end def validate() end def process() end end class ServiceCommand < ActionType @@services = { "pacemaker_remote" => [ "enable", "disable", "start", "stop", ] } def error(message) return PcsdExchangeFormat::Error.for_item("action", @id, message) end def validate() unless @action.has_key?(:service) raise self.error("'service' is missing") end unless @action.has_key?(:command) raise self.error("'command' is missing") end unless @@services.key?(@action[:service]) raise self.error( "unsupported 'service' ('#{@action[:service]}')"+ " supported are #{@@services.keys.sort}" ) end unless @@services[@action[:service]].include?(@action[:command]) raise self.error( "unsupported 'command' ('#{@action[:command]}') for service "+ "'#{@action[:service]}',"+ " supported are #{@@services[@action[:service]].sort}" ) end end def run_service_command() #validate here required or else there could be entered a disallowed #@action[:service] self.validate() case @action[:command] when "enable" return enable_service(@action[:service]) when "disable" return disable_service(@action[:service]) when "start" return start_service(@action[:service]) when "stop" return stop_service(@action[:service]) else #a mistake in @@services? raise self.error( "unsupported 'command' ('#{@action[:command]}') for service "+ "'#{@action[:service]}'" ) end end def process() return PcsdExchangeFormat::result( self.run_service_command() ? :success : :fail ) end end TYPES = { "service_command" => ServiceCommand, } end
Upload File
Create Folder