Bug 84574

Summary: /etc/rc.d/[cleanvar, cleartmp, abi, power_profile] violate rc.d standards
Product: Base System Reporter: Alexander Botero-Lowry <alex>
Component: confAssignee: Doug Barton <dougb>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Alexander Botero-Lowry 2005-08-05 08:00:35 UTC
      /etc/rc.d/cleanvar, cleartmp, abi, and power_profile do not follow Design and Implementation of the NetBSD rc.d System. [http://www.mewburn.net/luke/papers/rc.d.pdf]. When executed with rcvar each of these scripts behaves in a non standard way. cleanvar and cleartmp attempt to delete files which is a VERY bad behavior, if these scripts were to be run as root with simply rcvar (which SHOULD be harmless) they could damage the system (cleartmp could bring X11 down). abi prints superfolous garbage to the screen, and power_profile does not  have start or stop (or any standard behaviors of an rc.d script really.

Fix: 

power_profile should be moved. abi should be re written to only print text when start is called. cleartmp and cleanvar should be rewritten to only delete files within a start function (or in the case of cleartmp possibly split into a script like clearx11, that is set to start by default). Specific patches and recommendations for some of the problems I've already submitted and can be found at misc/83969 and conf/84030. This is a major issue though it may seem trivial because it doesn't allow for good managment tools for the rc.d system.
How-To-Repeat:       Mess around with the above mentioned rc scripts only minimally. (not as root you don't want to ruin X11 for example).
Comment 1 Doug Barton freebsd_committer freebsd_triage 2005-12-05 09:23:15 UTC
Responsible Changed
From-To: freebsd-bugs->dougb


I'll work on this issue
Comment 2 Doug Barton freebsd_committer freebsd_triage 2005-12-19 10:57:21 UTC
State Changed
From-To: open->patched


I've committed fixes for abi, cleanvar and cleartmp. 
power_profile will have to be dealt with differently, 
I will communicate with Nate about that.
Comment 3 Doug Barton freebsd_committer freebsd_triage 2006-01-17 07:16:45 UTC
State Changed
From-To: patched->closed


Fixes for abi, cleanvar, and cleartmp were just MFC'ed to 
RELENG_6. They will not be MFC'ed to RELENG_5. 

power_profile has other issues. In brief discussion with 
njl he indicated willingness to pursue this, but it will 
take some time to work out the best solution.