From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 16 17:20:36 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60C0D106566B for ; Sat, 16 Apr 2011 17:20:36 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.212.172]) by mx1.freebsd.org (Postfix) with ESMTP id 2E3D38FC08 for ; Sat, 16 Apr 2011 17:20:35 +0000 (UTC) Received: by pxi6 with SMTP id 6so4292848pxi.17 for ; Sat, 16 Apr 2011 10:20:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=BjqnrKFoTJk+T9pUbmyA/ygpGacqpbhP4jBBgBT7C6k=; b=woUFnWwmEFGAlrOuteM0/wxcCyCfHk98cD0/Nc7bgkKqIoYsjQlQOugFwIlYHhTosC wofYs3wUhIgwk1ofS2qAuOWS9XPSj95KzP7719YFj1gRmlR+dLFlMxWSvKVMouGx3cK8 QGJ6Xi9/mxyqV0tIO0YRQKUzv0o0+GN68lvlA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=c2Z6zt7MK8mmBfRMY4mhrtTsSN2UfS3gtnOuKvr5rzGSORqLCxeZLq/irlacKRrPeh A26acqVG0vj89EJmYVGfMMty0KdeKgueM1k+3O3G9APldMXTmUdR3V8raS5TlPhttWhF K/NXyi9W7kLDOEeP5YUQAh2AKrGzEQfAwVkZU= MIME-Version: 1.0 Received: by 10.68.11.226 with SMTP id t2mr3894870pbb.212.1302974435630; Sat, 16 Apr 2011 10:20:35 -0700 (PDT) Received: by 10.68.42.3 with HTTP; Sat, 16 Apr 2011 10:20:35 -0700 (PDT) In-Reply-To: <8DBD8E84-82A8-41F1-9AA3-A0E31440EF98@gsoft.com.au> References: <20110415.150349.671.1@DEV> <22B12EE4-AE7B-49F7-B6BA-3FE7F967F508@gsoft.com.au> <20110415.154921.875.2@DEV> <20110415.171211.343.3@DEV> <6F20BB76-0D6A-4AB5-99DF-15954D8C2C9D@gsoft.com.au> <20110416.111455.390.4@DEV> <20110416.142444.546.5@DEV> <8DBD8E84-82A8-41F1-9AA3-A0E31440EF98@gsoft.com.au> Date: Sat, 16 Apr 2011 10:20:35 -0700 Message-ID: From: Garrett Cooper To: "Daniel O'Connor" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: rank1seeker@gmail.com, freebsd-hackers@freebsd.org Subject: Re: Add SUM sysctl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2011 17:20:36 -0000 On Sat, Apr 16, 2011 at 8:41 AM, Daniel O'Connor wr= ote: > > On 16/04/2011, at 17:31, Freddie Cash wrote: >>> DO YOU KNOW, what to look for, in sys that will indicate to my function= , >>> that it is in SUM? >> >> No network configured, no daemons running, just a single shell >> running. =A0IOW, everything can be done manually in MUM to "simulate" >> SUM. > > My point is that the difference is only in your brain. > > The kernel doesn't know the difference because there isn't one. Well, not from its perspective. From init's/rc's perspective, sure.. there sort of is one. You could check for /var/run/dmesg.boot beforehand, but not if you're dropping into singleuser mode from multiuser mode. You can do some rc tricks to determine whether or not certain services have been started to achieve whatever you want to for your scripts. Thanks, -Garrett