Re: HEADS UP: set_rcvar() removed from rc.subr

From: Chris Rees <crees_at_freebsd.org>
Date: Sun, 15 Jan 2012 08:51:53 +0000
On 15 January 2012 08:11, Conrad J. Sabatier <conrads_at_cox.net> wrote:
> On Sat, 14 Jan 2012 15:30:15 +0000
> Chris Rees <crees_at_freebsd.org> wrote:
>
>> On 14 January 2012 15:16, Rainer Hurling <rhurlin_at_gwdg.de> wrote:
>> > On 14.01.2012 10:05 (UTC+1), Doug Barton wrote:
>> >>
>> >> Howdy,
>> >>
>> >> Per discussion in freebsd-rc_at_, I have removed set_rcvar() from
>> >> rc.subr. The concept of set_rcvar() was nice in theory, but the
>> >> forks it creates are a drag on the startup process, which is
>> >> especially noticeable on slower systems, such as embedded ones.
>> >>
>> >> I have no plans to MFC this change, so it should only affect users
>> >> who are actually on 10-current. If you have scripts
>> >> in /usr/local/etc/rc.d (which if you have ports installed you
>> >> almost certainly do) ...
>> >>
>> >> to make the change by hand, change this:
>> >>
>> >> name=foo
>> >> rcvar=`set_rcvar`
>> >>
>> >> to:
>> >>
>> >> name=foo
>> >> rcvar=foo_enable
>> >>
>> >> I didn't bump PORTREVISIONs because the change only applies to
>> >> HEAD. But all of the ports are updated, so if you can't figure out
>> >> how to make the change, just reinstall it.
>> >>
>> >>
>> >> Doug
>> >
>> >
>> > Seems that ports-mgmt/tinderbox needs an update like this:
>> >
>> > files/patch-etc__rc.d__tinderd
>> >
>> > --- etc/rc.d/tinderd.orig       2011-11-20 07:01:09.000000000 +0100
>> > +++ etc/rc.d/tinderd    2012-01-14 16:07:38.000000000 +0100
>> > _at__at_ -16,7 +16,7 _at__at_
>> >  . /etc/rc.subr
>> >
>> >  name="tinderd"
>> > -rcvar=`set_rcvar`
>> > +rcvar=tinderd_enable
>> >
>> >  # read settings, set default values
>> >  load_rc_config "${name}"
>> >
>>
>> I'm in the process of fixing this upstream.
>>
>> Chris
>
> Chris, if you're working on fixing ports' rc files, here are a few
> potential "gotchas" to be aware of:
>
> I did a little quick-and-dirty sed substitution on all of my files
> under /usr/local/etc/rc.d, plugging in "$filename_enable" in place of
> `set_rcvar`.  This works just fine for all but a few.
>
> Filenames containing hyphens must have underscores substituted (e.g.,
> avahi-daemon, etc.).
>
> In a few cases, the rcvar is different from the filename in other
> ways.  The only ones I came across in my local installation were
> sa-spamd (spamd_enable) and mysql-server (mysql_enable).  There are
> bound to be others like this in ports.
>
> Overall, though, it was a simple matter to fix up the scripts I had
> installed already.  If I can be of any assistance in tidying up the
> ports tree, let me know.

Don't thank me!

http://lists.freebsd.org/pipermail/cvs-ports/2012-January/233843.html

The only ones that will cause trouble are the ones provided by
upstream, but a quick sed like the one in ports-mgmt/tinderbox will do
the trick until upstream has finished.

Chris
Received on Sun Jan 15 2012 - 07:52:25 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:23 UTC