From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/622 Path: main.gmane.org!not-for-mail From: Lloyd Zusman Newsgroups: gmane.comp.sysutils.supervision.general Subject: Never mind ... (Was: When running ruby scripts, runsv tightly loops) Date: Sun, 07 Nov 2004 00:32:07 -0500 Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1099805818 2662 80.91.229.6 (7 Nov 2004 05:36:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 7 Nov 2004 05:36:58 +0000 (UTC) Original-X-From: supervision-return-861-gcsg-supervision=m.gmane.org@list.skarnet.org Sun Nov 07 06:36:46 2004 Return-path: Original-Received: from antah.skarnet.org ([212.85.147.14] ident=qmailr) by deer.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 1CQfjK-0004Nl-00 for ; Sun, 07 Nov 2004 06:36:46 +0100 Original-Received: (qmail 21663 invoked by uid 76); 7 Nov 2004 05:37:08 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 21657 invoked from network); 7 Nov 2004 05:37:08 -0000 X-Injected-Via-Gmane: http://gmane.org/ Original-To: supervision@list.skarnet.org Original-Lines: 60 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: hippo.asfast.net User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:OnW0IYkkP/8EpCb7u59iwMMhJ78= Original-Sender: news Xref: main.gmane.org gmane.comp.sysutils.supervision.general:622 X-Report-Spam: http://spam.gmane.org/gmane.comp.sysutils.supervision.general:622 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 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.