some rc.d cleanup

John Baldwin jhb at FreeBSD.org
Fri Aug 12 14:33:16 GMT 2005


On Thursday 11 August 2005 03:18 pm, Alexander Botero-Lowry wrote:
> I've bene working on making src/sbin/chkconfig from NetBSD a more complete
> clone of chkconfig from IRIX as well as making it work on FreeBSD. In this
> task I have run into some nasty bugs in the implementation of some rc.d
> scripts in FreeBSD. Some of these bugs are minor, some are not. cleanvar
> and cleartmp are the worst culprits. These scripts if executed with the
> argument rcvar (which should only return the configuration value for the
> script) execute rm on a bunch of files. This action should only happen when
> the switch start is passed. abi also writes text outside of its start
> functions, which can be messy. I have a patch for cleartmp (breaking the
> x11 part of it out into a seperate file that is run by default) and a half
> patch for abi at: http://alex.complete-systems.net/freebsd-rc.d.patch
>
> /etc/rc.d/power_profile is also an issue. It's not a real rc.d script and
> therefore should not be in /etc/rc.d.

I'm guessing this part is extra:

+ if checkyesno ${rcvar}; then
+        echo "sysv"
+ else
+        echo "you suck"
+ fi

in the abi script? :)

Also, why not just move the extra rm commands in cleartmp up into the 
cleartmp_start() function instead of creating a whole separate script?  I 
also don't understand why it matters that one use start_precmd instead of 
using echo in the foo_start() functions.

-- 
John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org


More information about the freebsd-hackers mailing list