From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/911 Path: news.gmane.org!not-for-mail From: "L. Jason Godsey" Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: Trying to alter runit a little. Date: Fri, 18 Nov 2005 03:07:04 -0800 (PST) Message-ID: <20051118110704.67248.qmail@web33306.mail.mud.yahoo.com> References: <20051117085412.28856.qmail@61a53ad4699a19.315fe32.mid.smarden.org> Reply-To: lannygodsey@yahoo.com NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1132312104 32606 80.91.229.2 (18 Nov 2005 11:08:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 18 Nov 2005 11:08:24 +0000 (UTC) Original-X-From: supervision-return-1147-gcsg-supervision=m.gmane.org@list.skarnet.org Fri Nov 18 12:08:21 2005 Return-path: Original-Received: from antah.skarnet.org ([212.85.147.14]) by ciao.gmane.org with smtp (Exim 4.43) id 1Ed45E-00013C-PT for gcsg-supervision@gmane.org; Fri, 18 Nov 2005 12:07:08 +0100 Original-Received: (qmail 20731 invoked by uid 76); 18 Nov 2005 11:07:29 -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 20725 invoked from network); 18 Nov 2005 11:07:28 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=RWiqNDXVJYlEqnmUCGLeItEnGhQhEUzZsMLlRmkDRQ9XA2ikPa4ZsvTJ8xAZQuqXYn69TQOK07bsX/8nVzXEaebnTGRwIT9OfgPHiTI4rabqZf7OBhqD4ywXoc2cmLWZScljwJQZYo2wONxd1vctgtUxERHcmq9123zYPhz8Wc4= ; Original-To: supervision@list.skarnet.org In-Reply-To: <20051117085412.28856.qmail@61a53ad4699a19.315fe32.mid.smarden.org> Xref: news.gmane.org gmane.comp.sysutils.supervision.general:911 Archived-At: build# diff -u runit.c.original runit.c --- runit.c.original Fri Nov 18 10:56:29 2005 +++ runit.c Fri Nov 18 10:57:41 2005 @@ -54,7 +54,7 @@ int ttyfd; struct stat s; - if (getpid() != 1) strerr_die2x(111, FATAL, "must be run as process no 1."); + //if (getpid() != 1) strerr_die2x(111, FATAL, "must be run as process no 1."); setsid(); sig_block(sig_alarm); build# pwd /usr/ports/sysutils/runit/work/admin/runit-1.3.1/src build# make check ./check-local chpst runit runit-init runsv runsvchdir runsvctrl runsvdir runsvstat sv svlogd svwaitdown svwaitup utmpset Checking chpst... Checking runit... Killed main# echo $? 137 #### Original build# cp runit.c.original runit.c ./check-local chpst runit runit-init runsv runsvchdir runsvctrl runsvdir runsvstat sv svlogd svwaitdown svwaitup utmpset Checking chpst... Checking runit... Checking runit-init... Checking runsv... Checking runsvchdir... Checking runsvctrl... Checking runsvdir... ... Something in Checking runit is making my FreeBSD 6 system have a stroke if I remove the line: if (getpid() != 1) strerr_die2x(111, FATAL, "must be run as process no 1."); --- Gerrit Pape wrote: > On Sat, Nov 12, 2005 at 07:02:24AM -0800, L. Jason Godsey wrote: > > I've removed the requirment for runit to be pid 1. I want to > replace > > init within a FreeBSD jail. The first process to run isn't pid 1. > > > > Do you see any problems that will become of this? > > The runit-init program, normally installed as /sbin/init sends > signals > to pid 1 when told to reboot or halt the system. The runit program > doesn't provide any other communication channel than signals > (combined > with magic files), so it relies on being the process with id 1. If > you > change that, nothing else should break but this IPC, but you then > have > the problem to find out the id of the runit process on shutdown. > Tools > like pidof are exactly what runit replaces with a reliable solution. > > > I just did a make package outside of the jail and the system froze, > I'm > > guessing the build process checks for error if runit is not pid 1. > > > > The machine locked up and I'll have to wait a few hours for someone > to > > go to the colo machine and power cycle it for me. > > I can't see how this relates to your change, building the package > should > never make the system hang, unless the system is buggy. > > Regards, Gerrit. >