Class: Cmdserver::CLI::ServerDaemonizer
- Inherits:
-
Daemonizer
- Object
- Daemonizer
- Cmdserver::CLI::ServerDaemonizer
- Defined in:
- lib/cmdserver/cli.rb
Instance Method Summary collapse
-
#_handle_sighup ⇒ Object
NOTE: Could use some logging mechanism…
- #_handle_sigterm ⇒ Object
- #daemon_preparation ⇒ Object
-
#initialize(server) ⇒ ServerDaemonizer
constructor
A new instance of ServerDaemonizer.
Methods inherited from Daemonizer
Constructor Details
#initialize(server) ⇒ ServerDaemonizer
Returns a new instance of ServerDaemonizer.
49 50 51 52 53 |
# File 'lib/cmdserver/cli.rb', line 49 def initialize(server) super() @server = server @dprocess = -> { server.start() } end |
Instance Method Details
#_handle_sighup ⇒ Object
NOTE: Could use some logging mechanism…
63 64 65 |
# File 'lib/cmdserver/cli.rb', line 63 def _handle_sighup() @server.reload_settings = true end |
#_handle_sigterm ⇒ Object
67 68 69 |
# File 'lib/cmdserver/cli.rb', line 67 def _handle_sigterm() @server.socket.close() end |
#daemon_preparation ⇒ Object
55 56 57 58 59 60 |
# File 'lib/cmdserver/cli.rb', line 55 def daemon_preparation super() logpath = Pathname.new(@server.settings.workdir) + Pathname.new(DAEMON_LOGFILE) $stdout.reopen(logpath, "a") $stderr = $stdout end |