Bug 24612

Summary: rm -rf of /var/run/* at boot should be replaced with find /var/run -type f -exec rm
Product: Base System Reporter: david <david>
Component: confAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.1-STABLE   
Hardware: Any   
OS: Any   

Description david 2001-01-24 16:00:01 UTC
In /etc/rc, in the function clean_var(), /var/run is cleaned out by running "rm -rf /var/run/*".  If one has created subdirectories in /var/run owned by other users, as I suggest in http://www.freebsd.org/cgi/query-pr.cgi?pr=22038, the existing approach removes those subdirectories and causes problems when the non-root daemons launch.

Fix: 

Replace
rm -rf /var/run/*
with
find /var/run -type f -exec rm {} \;
in /etc/rc:clean_var()
How-To-Repeat: mkdir /var/run/named
chown bind:bind /var/run/named
Configure named.conf with "options { pid-file "/var/run/named/named.pid"; };"
Reboot
Watch /var/log/messages for
Jan 14 00:20:41 gladden named[112]: couldn't create pid file '/var/run/named/named.pid'
Comment 1 Brian Somers freebsd_committer freebsd_triage 2001-01-25 15:11:06 UTC
State Changed
From-To: open->closed

Unfortunately find is on /usr which isn't yet available.