Date: Mon, 18 Apr 2011 13:52:15 +0200 From: rank1seeker@gmail.com To: freebsd-hackers@freebsd.org Subject: Re: Add SUM sysctl Message-ID: <20110418.115215.546.1@DEV> In-Reply-To: <E1QBQoh-000EDX-AP@kabab.cs.huji.ac.il> References: <8CDCA9824BFE47E-176C-A720@web-mmc-d04.sysops.aol.com> <alpine.BSF.2.00.1104161634150.5936@wonkity.com> <20110416233839.GA72223@DataIX.net> <E1QBQoh-000EDX-AP@kabab.cs.huji.ac.il>
next in thread | previous in thread | raw e-mail | index | archive | help
I would like, to thank you all, for your ideas.=0D=0A=0D=0AThere are 2 ways = of going into SUM (Single user mode)=0D=0A1) Rebooting into it=0D=0A2) = Drop from MUM=0D=0A=0D=0AMy solution MUST cover both cases, of entering = into SUM.=0D=0A=0D=0AOnce I enter SUM, I set it up, via 1 script, which = enables deamons and other stuff, that I need, for certain task. (i.e; I = wana use mouse, so I activate moused ...)=0D=0ANow, after those steps, if = that machine is web server, which serves only static content, then = enabling apache, makes it fully functional server, in SUM!=0D=0AI see = now, that both SUM and MUM define BOOTED/STARTED/RUNNING FreeBSD. -> = Thx, to Daniel O'Connor, for pointing into this direction.=0D=0ASo SUM = defines basic functionality and MUM ...=0D=0ASo where is a BORDER of SUM = and MUM. How many "stuff" has to be enabled/activated to decalre it as = MUM, instead of SUM?=0D=0AWhere does exactly SUM, becomes MUM. As long as = kernel is being asked, it doesn't differentiate between SUM and = MUM.=0D=0AKernel "sees" amonut of "pressure" induced by deamones, users, = processes.=0D=0A=0D=0ANow to cut that chatter short, to solution = ...=0D=0A=0D=0AI've tried by looking at init state:=0D=0A# ps -U root | = grep 'init -s'=0D=0ABUT, after exiting into MUM, from SUM:=0D=0ASUM->MUM = (/sbin/init -s) 'init -s' remained.=0D=0AIf sys booted directly into MUM, = I see (/sbin/init --), which also remains upon drop to SUM.=0D=0ASo init = state can only be used, to determine, how sys has been = booted/started.=0D=0A=0D=0ATo cut it even shorter (skipping tried sysctl = vars, env, etc ...)=0D=0A=0D=0A=0D=0ASolution, which passed my = requirement, was one from J. Hellenthal's advice.=0D=0AThx!=0D=0AIt = works, with both cases of entering into SUM.=0D=0AAlso covers case, where = I enable stuff, that I need in SUM and which could confuse function, into = thinking it is in MUM.=0D=0A=0D=0A=0D=0AHere is an resulting function: = (/bin/sh)=0D=0A--=0D=0A# Are we in a SUM=0D=0Ain_sum ()=0D=0A{=0D=0A = if [ "`/bin/pgrep -x getty`" ]; then=0D=0A return 1=0D=0A = else=0D=0A return 0=0D=0A = fi=0D=0A}=0D=0A--=0D=0A=0D=0A=0D=0ADomagoj Smol=E8i=E6=0D=0A
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110418.115215.546.1>