From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1471 Path: news.gmane.org!not-for-mail From: Alex Efros Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: runit not collecting zombies Date: Sat, 7 Jul 2007 22:12:19 +0300 Organization: asdfGroup Inc., http://powerman.asdfGroup.com/ Message-ID: <20070707191219.GA1538@home.power> References: <20070618134516.GA1560@home.power> <20070619181325.23252.qmail@a92f927aabd53f.315fe32.mid.smarden.org> <20070619190751.GC27090@home.power> <20070620162325.26345.qmail@7d91355cde742c.315fe32.mid.smarden.org> <20070620165736.GC12963@home.power> <20070620183532.4571.qmail@9f638fd8b69905.315fe32.mid.smarden.org> <20070623044205.GA1594@home.power> <20070626095920.6195.qmail@3e147d410b1c2c.315fe32.mid.smarden.org> <20070707071657.GA1517@home.power> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1183835544 2988 80.91.229.12 (7 Jul 2007 19:12:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 7 Jul 2007 19:12:24 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-1708-gcsg-supervision=m.gmane.org@list.skarnet.org Sat Jul 07 21:12:22 2007 connect(): Connection refused Return-path: Envelope-to: gcsg-supervision@gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by lo.gmane.org with smtp (Exim 4.50) id 1I7Fhe-0005O9-Al for gcsg-supervision@gmane.org; Sat, 07 Jul 2007 21:12:22 +0200 Original-Received: (qmail 6472 invoked by uid 76); 7 Jul 2007 19:12:43 -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 6464 invoked from network); 7 Jul 2007 19:12:43 -0000 Mail-Followup-To: supervision@list.skarnet.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1471 Archived-At: Hi! On Sat, Jul 07, 2007 at 02:13:48PM -0400, Charlie Brady wrote: > What happens if your cron line is: > > */1 * * * * chpst -L /var/www/soft.p/html/.lib/var/.lock.service > runsvdir /var/www/soft.p/html/.lib/var/service/ > > ? According to crontab(1): No attempt will be made to issue commands lost due to a reboot, and commands are not reissued if the previously issued command is still running. it may be enough to do even this: */1 * * * * runsvdir /var/www/soft.p/html/.lib/var/service/ But. I don't know how reliable this feature in my cron daemon (I'm using `dcron') and how it realized. And I know `chpst -L` is reliable and I know how it works. So I'd prefer to use known reliable solution. (Moreover, cron daemon can be any, not only dcron - I'd like to use same crontab configuration line which will work with any cron daemon.) Anyway, my code can be 'overkill' or ugly, but it working correctly and it does nothing really 'wrong'. Yeah, it produce zombie, but that zombie must be reaped by process N1. > Why are you starting a new runsvdir every minute? Because I need to restart user-controlled services under runsvdir after reboot without any special configuration done by 'root'. > What are you actually trying to achieve? - perhaps someone can suggest a > less "unusual" design. Okay. I've a several independent web projects. These projects are complex enough, and contain not only CGI scripts and database, but also cron scripts, command line utilities, and network daemons. All these applications should not require 'root' to setup and should be 100% manageable by user. To have single point for managing log files for all these scripts I run separate `socklog unix /custom/path` for each of these web projects, and all scripts (CGI, cron, network daemons, etc.) in each project use that '/custom/path' (different for each project, of course) UNIX socket for logging. So, I need at least single 'service' for each web project: socklog. Some projects also have other custom services like network daemons. All these services should be running as reliable as usual system services in /var/service/* and should be restarted after system reboot. I solved this by using runsvdir to run services and using user's crontab to start (and restart after system reboot or killing runsvdir) runsvdir. To avoid multiple execution of runsvdir for same directory with services I use `chpst -L`. That's all. -- WBR, Alex.