supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* When running ruby scripts, runsv tightly loops
@ 2004-11-07  5:10 Lloyd Zusman
  2004-11-07  5:32 ` Never mind ... (Was: When running ruby scripts, runsv tightly loops) Lloyd Zusman
  0 siblings, 1 reply; 4+ messages in thread
From: Lloyd Zusman @ 2004-11-07  5:10 UTC (permalink / raw)


I'm successfully using runit for managing a number of daemons.  However,
I have encountered a problem when the daemon is a ruby script.

It seems like no matter what the script is doing, the runsv process that
is managing the script seems to be running in a tight loop and taking up
a high percentage of my cpu.  This even occurs during a do-nothing ruby
program, such as the following:

  #!/usr/bin/ruby
  while true
    sleep(10)
  end

Assuming that this is called '/usr/local/bin/myscript', the 'run'
script looks like this:

  #!/bin/sh

  exec 2>&1

  exec /usr/local/bin/myscript

  exit 1

The 'myscript' process itself takes up a miniscule amount of resources;
only the 'runit' script which is managing it seems to be looping.

Has anyone else run into this problem with ruby scripts and runit?

By the way, I don't see this problem with python or perl scripts.

Could there be something about the ruby interpreter itself which could
be causing runsv to behave this way?  If so, can anyone suggest a
fix for this?

Thanks in advance.

-- 
 Lloyd Zusman
 ljz@asfast.com
 God bless you.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Never mind ... (Was: When running ruby scripts, runsv tightly loops)
  2004-11-07  5:10 When running ruby scripts, runsv tightly loops Lloyd Zusman
@ 2004-11-07  5:32 ` Lloyd Zusman
  2004-11-07 13:55   ` Gerrit Pape
  0 siblings, 1 reply; 4+ messages in thread
From: Lloyd Zusman @ 2004-11-07  5:32 UTC (permalink / raw)


It turns out that there was a file permissions problem within the runit
directory structure for managing my ruby daemon.  Once I corrected it,
runsv stopped looping.  Therefore, this had nothing to do with the ruby
interpreter.

All is well now.

I'm sorry for the bandwidth.


Lloyd Zusman <ljz@asfast.com> writes:

> I'm successfully using runit for managing a number of daemons.  However,
> I have encountered a problem when the daemon is a ruby script.
>
> It seems like no matter what the script is doing, the runsv process that
> is managing the script seems to be running in a tight loop and taking up
> a high percentage of my cpu.  This even occurs during a do-nothing ruby
> program, such as the following:
>
>   #!/usr/bin/ruby
>   while true
>     sleep(10)
>   end
>
> Assuming that this is called '/usr/local/bin/myscript', the 'run'
> script looks like this:
>
>   #!/bin/sh
>
>   exec 2>&1
>
>   exec /usr/local/bin/myscript
>
>   exit 1
>
> The 'myscript' process itself takes up a miniscule amount of resources;
> only the 'runit' script which is managing it seems to be looping.
>
> Has anyone else run into this problem with ruby scripts and runit?
>
> By the way, I don't see this problem with python or perl scripts.
>
> Could there be something about the ruby interpreter itself which could
> be causing runsv to behave this way?  If so, can anyone suggest a
> fix for this?
>
> Thanks in advance.
>
> -- 
>  Lloyd Zusman
>  ljz@asfast.com
>  God bless you.
>
>

-- 
 Lloyd Zusman
 ljz@asfast.com
 God bless you.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Never mind ... (Was: When running ruby scripts, runsv tightly loops)
  2004-11-07  5:32 ` Never mind ... (Was: When running ruby scripts, runsv tightly loops) Lloyd Zusman
@ 2004-11-07 13:55   ` Gerrit Pape
  2004-11-07 20:59     ` Never mind Lloyd Zusman
  0 siblings, 1 reply; 4+ messages in thread
From: Gerrit Pape @ 2004-11-07 13:55 UTC (permalink / raw)


On Sun, Nov 07, 2004 at 12:32:07AM -0500, Lloyd Zusman wrote:
> It turns out that there was a file permissions problem within the runit
> directory structure for managing my ruby daemon.  Once I corrected it,
> runsv stopped looping.  Therefore, this had nothing to do with the ruby
> interpreter.

Hm, if runsv has trouble starting the run script, it should pause for a
second before retrying, and not take up a high percentage of cpu.  Can
you say what exactly was the permissions problem?

Thanks, Gerrit.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Never mind ...
  2004-11-07 13:55   ` Gerrit Pape
@ 2004-11-07 20:59     ` Lloyd Zusman
  0 siblings, 0 replies; 4+ messages in thread
From: Lloyd Zusman @ 2004-11-07 20:59 UTC (permalink / raw)


Gerrit Pape <pape@smarden.org> writes:

> Hm, if runsv has trouble starting the run script, it should pause for a
> second before retrying, and not take up a high percentage of cpu.  Can
> you say what exactly was the permissions problem?
>
> Thanks, Gerrit.

Well, all I noticed when I started poking around in the directory is
that I got 'access denied' errors on some of the files there.  At that
point, I deleted the entire directory and recreated it, and then
everything worked.  I assume that this has to do with ownership or file
permissions.

I'm sorry that I can't give you more info.  Next time something like
this happens, I'll do a better job of collecting data before changing
anything.


-- 
 Lloyd Zusman
 ljz@asfast.com
 God bless you.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-11-07 20:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-07  5:10 When running ruby scripts, runsv tightly loops Lloyd Zusman
2004-11-07  5:32 ` Never mind ... (Was: When running ruby scripts, runsv tightly loops) Lloyd Zusman
2004-11-07 13:55   ` Gerrit Pape
2004-11-07 20:59     ` Never mind Lloyd Zusman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).