Support Requests: Browse | Submit New | Admin

[#29570] How to restart daemon from itself

Date:
2012-05-11 18:08
Priority:
3
Submitted By:
Evgeniy Solovyov (lunsher)
Assigned To:
Thomas Uehlinger (uehli)
Category:
None
State:
Open
Summary:
How to restart daemon from itself

Detailed description
I am using tweetstream gem which utilize Deamons to  daemonize stream.Also i new to collect some new params regularly
for proc in daemon and reinit daemon each time.

In fact i sutisfied what restart command do.
Example is: ruby stream.rb restart

Question is how can i restart daemon from proc itself?

Daemons.run_proc(@app_name, @daemon_options) do
      <<<< here ?
end

Add A Comment: Notepad

Please login


Followup

Message
Date: 2012-05-12 09:14
Sender: Thomas Uehlinger

Although I have not tested this, you could try to run another
daemon in the proc, i.e.

Daemons.run_proc(@app_name, @daemon_options) do
      Daemons.run_proc(@app_name, @daemon_options) do
            ....
      end
end

and then in that second daemon stop the app of the main daemon
and start a new proc from there.
Date: 2012-05-11 18:22
Sender: Evgeniy Solovyov

In fact i have tryied
Daemons.controller.command = 'restart'
Daemons.controller.run
-nothing happens
Call directly
Daemons.controller.group.stop_all
sleep(1)
Daemons.controller.group.start_all
-it just stops

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
assigned_tonone2012-05-12 09:14uehli