Module: Kryten::Summoner
- Defined in:
- lib/kryten/summoner.rb
Instance Method Summary collapse
- #daemon ⇒ Object
- #init_daemon ⇒ Object
- #pid ⇒ Object
- #start_daemon ⇒ Object
- #status ⇒ Object
- #stop ⇒ Object
Instance Method Details
#daemon ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/kryten/summoner.rb', line 37 def daemon raise 'Initialize daemon first with init_daemon' unless @daemon # run_proc with :multiple creates an application group (stack) # if there are multiple daemons with the same name, # the curent daemon is the last entry @daemon.applications.last end |
#init_daemon ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/kryten/summoner.rb', line 24 def init_daemon = { log_output: false, backtrace: false, multiple: true, ARGV: ['start'], show_status_callback: :customstatus } @daemon = Daemons.run_proc(name, ) { start } end |
#pid ⇒ Object
53 54 55 |
# File 'lib/kryten/summoner.rb', line 53 def pid daemon.pid.pid end |
#start_daemon ⇒ Object
45 46 47 |
# File 'lib/kryten/summoner.rb', line 45 def start_daemon daemon.start end |
#status ⇒ Object
57 58 59 |
# File 'lib/kryten/summoner.rb', line 57 def status daemon.show_status end |
#stop ⇒ Object
49 50 51 |
# File 'lib/kryten/summoner.rb', line 49 def stop daemon.stop end |