From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1597 Path: news.gmane.org!not-for-mail From: Bernhard Graf Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: using runit as init Date: Sat, 5 Jan 2008 01:06:50 +0100 Message-ID: <200801050106.53334.list-supervision@augensalat.de> References: <200801032151.21524.list-supervision@augensalat.de> <200801031722.26992.mike@geekgene.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1199491622 9904 80.91.229.12 (5 Jan 2008 00:07:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Jan 2008 00:07:02 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-1832-gcsg-supervision=m.gmane.org@list.skarnet.org Sat Jan 05 01:07:22 2008 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 1JAwZN-0000C8-Ti for gcsg-supervision@gmane.org; Sat, 05 Jan 2008 01:07:21 +0100 Original-Received: (qmail 5295 invoked by uid 76); 5 Jan 2008 00:07:04 -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 5289 invoked from network); 5 Jan 2008 00:07:04 -0000 User-Agent: KMail/1.9.1 In-Reply-To: <200801031722.26992.mike@geekgene.com> Content-Disposition: inline Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1597 Archived-At: Mike Buland wrote: > In general, if you want to retain init-style runlevels, then you > don't want to replace SysV init. I have switched to runit entirely, > it manages every service, and it does indeed support "runlevels." > See > http://smarden.org/runit/runsvchdir.8.html for details. Each runit > runlevel is really just another service directory, runsvchdir changes > which service directory you are using. the runit "init" program is > provided mainly for compatibility. > > There is no reason for runlevels to be numbered, and the kernel > offers no support for runlevels, nor do any bootloaders. When you > pass 2, 3, 4, S, etc. to the kernel, it is ignored as an unrecognized > parameter, but made available to running processes a number of ways. > Runit makes the commandline as well as any variables that are set on > the kernel commandline available to the script 1 (and maybe 2 and 3, > but I use it in 1). Therefore if you set a variable in the > bootloader on the kernel commandline named "runlevel" then you can > use that in script 1 to change your runlevel. > > However, I would say based on the way you are using runit as process > 1, you would probably be better off sticking with sysvinit and adding > runsvdir to your inittab (a script very similar to the example script > 2 provided with runit is just what you want). As I wrote in my previous email I want an easy way to switch from SysV init to runit (or may be another one that supports process supervision). Since I have to care for a couple of production systems this switch must meet some conditions: - full support for the old init system - keep manual adjusting to a minimum ATM I'm starting daemontools svscan from inttab on those hosts in addition to the normal SysV init stuff. This works but is not really pretty - I'd like to have a more consistent administration interface. The goal is to install runit with RPM, reboot and then link the daemontools things into runit's service directory. > As for the runlevel code, I got this from this very list a long time > ago, give it a shot in script 1: > > # Set runlevel to: > # - single if kernel has param: S > # - RUNLEVELNAME if kernel has param: runlevel=RUNLEVELNAME > # - default if kernel has no params or unable to set requested > runlevel grep -q '\(^\| \)S\( \|$\)' /proc/cmdline && > runlevel='single' runsvchdir ${runlevel:-default} || runsvchdir > default Good tip! /proc/cmdline seems a smart way. Question 1 resolved. :-) > utmp/wtmp support is done, I believe, through an external program, > check out the getty*/finish scripts that are provided with the > default distribution. utmpset only clears lines from utmp, there is no way of setting anything as the name suggest. -- Bernhard Graf