Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Oct 2010 10:36:46 -0700
From:      Devin Teske <dteske@vicor.com>
To:        Garrett Cooper <gcooper@FreeBSD.org>
Cc:        Brandon Gooch <jamesbrandongooch@gmail.com>, freebsd-hackers@freebsd.org
Subject:   Re: sysrc -- a sysctl(8)-like utility for managing /etc/rc.conf et. al.
Message-ID:  <0206CB74-6E83-4762-B26D-F95E024C90F0@vicor.com>
In-Reply-To: <AANLkTim7QcAPSJHt9D-P3XggO5dFgHGGVSzwM=a3Ez5E@mail.gmail.com>
References:  <1286397912.27308.40.camel@localhost.localdomain> <AANLkTikoohMo5ng-RM3tctTH__P6cqhQpm=FPhSE9mMg@mail.gmail.com> <51B4504F-5AA4-47C5-BF23-FA51DE5BC8C8@vicor.com> <4CAD513F.3010903@DataIX.net> <D5D9B585-96DA-4BD0-899D-A7BFFC0C540C@vicor.com> <4CAD7563.1070706@DataIX.net> <4CAD7CA1.4050202@freebsd.org> <AANLkTim7QcAPSJHt9D-P3XggO5dFgHGGVSzwM=a3Ez5E@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On Oct 9, 2010, at 10:03 AM, Garrett Cooper wrote:

> On Thu, Oct 7, 2010 at 12:54 AM, Julian Elischer <julian@freebsd.org> =
wrote:
>>  On 10/7/10 12:23 AM, jhell wrote:
>>>=20
>>> Alright thank you for your explanation. I do not normally see this =
usage
>>> and this just sort of stood out at me and I did not want to assume =
what
>>> you were trying to accomplish, without asking.
>>=20
>> three useage cases come to mind immediately.
>>=20
>> 1/ use within other scripts..
>>  instead of the dozens of homegrown solutions people have written for =
puting
>> something
>> into /etc/rc.conf  one can use this.
>>=20
>> 2/ what is the value of X on machines a,b,c
>>  foreach machine in a b c
>>  do
>>      ssh $machine sysrc X
>>  done
>>=20
>>    you may well say "you could have used grep" bu tgrep doesn't give =
the
>> default value vie the
>>   hierachy of .rc files.
>> 2A is of course to correc teh values found to be wrong with (2)
>>=20
>> 3/ on a really small system, without an editor this may do a cleaner =
job
>> than the usual
>>  "grep -v X /etc/rc.conf >/tmp/x;echo X >> /tmp/x; mv /tmp/x =
/etc/rc.conf"
>=20
>    I was going to say...
>=20
> 3A On a system where you're logged in via singleuser, sometimes
> terminal settings don't work correctly with editors (these days it's
> mostly because /usr isn't available so it can't load ncurses apps,
> some libs, termcap, etc). That would be a lifesaver in this case.

I hadn't realized that. That's stupendous!

Though I do believe that `/rescue/vi' exists these days as a =
statically-linked binary (built using crunchgen(1) via =
`rescue/rescue/Makefile' in the FreeBSD source tree).


>    But then I realized that this command probably would live in
> /usr/sbin and would probably need other apps in /usr/bin // /usr/sbin
> to run this command :).

I envisioned it living in `/sbin' and it's actually free of dependencies =
to external executables. If you execute it with the "-d" option ('d' for =
'dependencies'), you can see that it uses only shell internals. The only =
thing this script truly depends on is `/bin/sh'. So it sounds like it =
would fit the ability of working within single-user mode quite well =
(remember, I developed it for embedded systems -- where things like =
grep/sed/awk may even be missing).


> Thanks!
> -Garrett
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to =
"freebsd-hackers-unsubscribe@freebsd.org"

--
Cheers,
Devin Teske

-> CONTACT INFORMATION <-
Business Solutions Consultant II
FIS - fisglobal.com
510-735-5650 Mobile
510-621-2038 Office
510-621-2020 Office Fax
909-477-4578 Home/Fax
devin.teske@fisglobal.com

-> LEGAL DISCLAIMER <-
This message  contains confidential  and proprietary  information
of the sender,  and is intended only for the person(s) to whom it
is addressed. Any use, distribution, copying or disclosure by any
other person  is strictly prohibited.  If you have  received this
message in error,  please notify  the e-mail sender  immediately,
and delete the original message without making a copy.

-> FUN STUFF <-
-----BEGIN GEEK CODE BLOCK-----
Version 3.1
GAT/CS d(+) s: a- C++(++++) UB++++$ P++(++++) L++(++++) !E--- W++ N? o? =
K- w O
M+ V- PS+ PE Y+ PGP- t(+) 5? X+(++) R>++ tv(+) b+(++) DI+(++) D(+) G+>++ =
e>+ h
r>++ y+=20
------END GEEK CODE BLOCK------
http://www.geekcode.com/

-> END TRANSMISSION <-




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0206CB74-6E83-4762-B26D-F95E024C90F0>