supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Alex Efros <powerman@powerman.asdfGroup.com>
To: supervision@list.skarnet.org
Subject: Re: Initial runlevel through kernel parameters
Date: Sat, 28 Apr 2007 00:09:23 +0300	[thread overview]
Message-ID: <20070427210923.GA6392@home.power> (raw)
In-Reply-To: <200704271504.32399.mike@geekgene.com>

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.


      reply	other threads:[~2007-04-27 21:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-27 16:41 Mike Buland
2007-04-28  0:33 ` Alejandro Mery
2007-04-27 21:04   ` Mike Buland
2007-04-27 21:09     ` Alex Efros [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070427210923.GA6392@home.power \
    --to=powerman@powerman.asdfgroup.com \
    --cc=supervision@list.skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).