[Ovirt-devel] [PATCH] wrappers for taskomatic.rb and host-status.rb

Hugh O. Brock hbrock at redhat.com
Tue May 6 15:56:15 UTC 2008


On Fri, May 02, 2008 at 12:41:02PM -0500, steve linabery wrote:
> 
> Hi Hugh and ovirt,
> 
> Well, it turns out it is even simpler than that. All I really needed
> to do was look at host-keyadd, which cooperates well with daemon &
> killproc by doing 'include Daemonize' and calling 'daemonize', as
> you'll see in the attached patch.
> 
> Patch adjusts taskomatic.rb and host-status.rb accordingly, and now
> they play nice with /etc/init.d/ovirt-wui script.
> 
> Good day,
> Steve Linabery

> diff --git a/wui/src/host-status/host-status.rb b/wui/src/host-status/host-status.rb
> index b6672cf..5063197 100755
> --- a/wui/src/host-status/host-status.rb
> +++ b/wui/src/host-status/host-status.rb
> @@ -24,6 +24,7 @@ require 'rubygems'
>  require 'libvirt'
>  require 'optparse'
>  require 'daemons'
> +include Daemonize
>  
>  $logfile = '/var/log/ovirt-wui/host-status.log'
>  
> @@ -49,7 +50,7 @@ rescue OptionParser::InvalidOption
>  end
>  
>  if do_daemon
> -  Daemons.daemonize
> +  daemonize
>    STDOUT.reopen $logfile, 'a'
>    STDERR.reopen STDOUT
>  end
> diff --git a/wui/src/task-omatic/taskomatic.rb b/wui/src/task-omatic/taskomatic.rb
> index d74f430..c112909 100755
> --- a/wui/src/task-omatic/taskomatic.rb
> +++ b/wui/src/task-omatic/taskomatic.rb
> @@ -24,6 +24,7 @@ $: << File.join(File.dirname(__FILE__), ".")
>  require 'rubygems'
>  require 'optparse'
>  require 'daemons'
> +include Daemonize
>  
>  $logfile = '/var/log/ovirt-wui/taskomatic.log'
>  
> @@ -49,7 +50,7 @@ rescue OptionParser::InvalidOption
>  end
>  
>  if do_daemon
> -  Daemons.daemonize
> +  daemonize
>    STDOUT.reopen $logfile, 'a'
>    STDERR.reopen STDOUT
>  end

I have committed this, thanks!

--Hugh




More information about the ovirt-devel mailing list