Class: Lita::Daemon Deprecated
- Inherits:
-
Object
- Object
- Lita::Daemon
- Defined in:
- lib/lita/daemon.rb
Overview
Deprecated.
Will be removed in Lita 5.0. Use your operating system’s process manager instead.
Converts Lita to a daemon process.
Instance Method Summary collapse
-
#daemonize ⇒ void
Converts Lita to a daemon process.
-
#initialize(pid_path, log_path, kill_existing) ⇒ Daemon
constructor
A new instance of Daemon.
Constructor Details
#initialize(pid_path, log_path, kill_existing) ⇒ Daemon
Returns a new instance of Daemon.
10 11 12 13 14 |
# File 'lib/lita/daemon.rb', line 10 def initialize(pid_path, log_path, kill_existing) @pid_path = pid_path @log_path = log_path @kill_existing = kill_existing end |
Instance Method Details
#daemonize ⇒ void
This method returns an undefined value.
Converts Lita to a daemon process.
18 19 20 21 22 23 24 |
# File 'lib/lita/daemon.rb', line 18 def daemonize handle_existing_process Process.daemon(true) File.open(@pid_path, "w") { |f| f.write(Process.pid) } set_up_logs at_exit { FileUtils.rm(@pid_path) if File.exist?(@pid_path) } end |