From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1408 Path: news.gmane.org!not-for-mail From: Alex Efros Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: Initial runlevel through kernel parameters Date: Sat, 28 Apr 2007 00:09:23 +0300 Organization: asdfGroup Inc., http://powerman.asdfGroup.com/ Message-ID: <20070427210923.GA6392@home.power> References: <200704271041.10379.mike@geekgene.com> <20070427203318.6a7a00b1@rafaella.bq.cl> <200704271504.32399.mike@geekgene.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1177708178 32087 80.91.229.12 (27 Apr 2007 21:09:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 27 Apr 2007 21:09:38 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-1645-gcsg-supervision=m.gmane.org@list.skarnet.org Fri Apr 27 23:09:37 2007 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 1HhXhA-0006bl-Rp for gcsg-supervision@gmane.org; Fri, 27 Apr 2007 23:09:36 +0200 Original-Received: (qmail 2925 invoked by uid 76); 27 Apr 2007 21:09:58 -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 2919 invoked from network); 27 Apr 2007 21:09:55 -0000 Mail-Followup-To: supervision@list.skarnet.org Content-Disposition: inline In-Reply-To: <200704271504.32399.mike@geekgene.com> User-Agent: Mutt/1.5.13 (2006-08-11) Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1408 Archived-At: Hi! On Fri, Apr 27, 2007 at 03:04:32PM -0600, Mike Buland wrote: > > in linux to parse the command line is as simple as: > > set -- $( cat /proc/cmdline ) > That's so simple and obvious, I don't really know what to say. Thank you so > much for your prompt and useful help! Actually in /etc/runit/1 you ALREADY have kernel params available as environment variables. For example, I add param 'runlevel=console' to kernel and then I can just do in /etc/runit/1: runsvchdir $runlevel Full version of my support for runlevels from /etc/runit/1 is here: # 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 -- WBR, Alex.