Module: DevDNSd::System
- Extended by:
- ActiveSupport::Concern
- Included in:
- Application
- Defined in:
- lib/devdnsd/system.rb
Overview
System management methods.
Instance Method Summary (collapse)
-
- (Boolean) action_restart
Restarts the server in background.
-
- (Boolean) action_start
Starts the server in background.
-
- (Boolean) action_status
Shows the status of the server.
-
- (Boolean) action_stop
Stops the server in background.
-
- (String) daemon_name
(also: #name)
Returns the name of the daemon.
-
- (String) log_directory
Returns the standard location of the log file.
-
- (String) log_file_path
Returns the complete path of the log file.
-
- (String) process_file_path
Returns the complete path of the PID file.
-
- (String) working_directory
(also: #runtime_directory)
Returns the standard location of the PID file.
Instance Method Details
- (Boolean) action_restart
Restarts the server in background.
74 75 76 77 78 |
# File 'lib/devdnsd/system.rb', line 74 def action_restart action_stop action_start true end |
- (Boolean) action_start
Starts the server in background.
54 55 56 57 58 59 60 61 |
# File 'lib/devdnsd/system.rb', line 54 def action_start logger.info(i18n.starting) prepare_start @config.foreground ? perform_server : self.class.start true end |
- (Boolean) action_status
Shows the status of the server
83 84 85 86 87 88 |
# File 'lib/devdnsd/system.rb', line 83 def action_status status = self.class.status status = :crashed if status == :unknown && self.class.crashed? log_status(self.class.controller.pid, status) end |
- (Boolean) action_stop
Stops the server in background.
66 67 68 69 |
# File 'lib/devdnsd/system.rb', line 66 def action_stop self.class.stop true end |
- (String) daemon_name Also known as: name
Returns the name of the daemon.
16 17 18 |
# File 'lib/devdnsd/system.rb', line 16 def daemon_name config ? File.basename(config.pid_file, ".pid") : "devdnsd" end |
- (String) log_directory
Returns the standard location of the log file.
47 48 49 |
# File 'lib/devdnsd/system.rb', line 47 def log_directory File.dirname(config.log_file) end |
- (String) log_file_path
Returns the complete path of the log file.
40 41 42 |
# File 'lib/devdnsd/system.rb', line 40 def log_file_path config.log_file end |
- (String) process_file_path
Returns the complete path of the PID file.
33 34 35 |
# File 'lib/devdnsd/system.rb', line 33 def process_file_path config ? config.pid_file : Dir.pwd + "devdnsd.pid" end |
- (String) working_directory Also known as: runtime_directory
Returns the standard location of the PID file.
25 26 27 |
# File 'lib/devdnsd/system.rb', line 25 def working_directory config ? File.dirname(config.pid_file) : Dir.pwd end |