cpuset, setfib and other features (not) supported by rc.subr
Miroslav Lachman
000.fbsd at quip.cz
Thu Jan 7 19:31:38 UTC 2010
Hi,
I would like to discuss adding general support in to rc.subr for things
like cpuset, setfib etc.
FreeBSD has some useful features (compared to other OSes) but those are
not generally supported by rc.subr.
For example setfib support is added (reinvented again and again) on per
rc script basis in base rc scripts and in ports rc scripts too.
cpuset has no support at all.
I think that adding support in rc.subr is the right way to do things
like this. Then these features will be available to all (or most of) rc
scripts without need to modify them and these feature will become more
used by more people.
I created patch for cpuset:
conf/142434: [patch] Add cpuset(1) support to rc.subr
http://www.freebsd.org/cgi/query-pr.cgi?pr=142434
There is also patch for setfib:
conf/132483: rc.subr(8) [patch] setfib(1) support for rc.subr
http://www.freebsd.org/cgi/query-pr.cgi?pr=132483
patch for rtprio:
conf/99444: [patch] Enhancement: rc.subr could easily support starting
some daemons with realtime priorities
http://www.freebsd.org/cgi/query-pr.cgi?pr=99444
conf/123222: [patch] Add rtprio(1)/idprio(1) support to rc.subr(8)
http://www.freebsd.org/cgi/query-pr.cgi?pr=123222
Or more general way to use "any" wrapper for starting services
conf/88913: [patch] wrapper support for rc.subr
http://www.freebsd.org/cgi/query-pr.cgi?pr=88913
All these patches are very similar.
I tested just my own patch for cpuset and found that there is some edge
case where it is not working - rc.d/jail. It is becaues of the nature
how rc.d/jail works - it starts jails by internal command in a loop
instead of rc.subr things, so it will not use cpuset for jails, but
nothing goes wrong.
I did not tested something using _chroot as I did not found any rc
script with it.
What are the objections to not use / commit things like patches above?
Do you think it is not the right way to have these features included in
rc.subr and is better to write it in each rc script separately? Or is
there any other problem with general use of setfib and cpuset?
I think setfib and cpuset can be useful for all daemons and jails
started by rc scripts. Especially cpuset on newer machines with more and
more CPU cores and setfib for network daemons with profiles like Apache
(currently Apache has its own implementation in rc script)
Miroslav Lachman
More information about the freebsd-rc
mailing list