From blank@sliphost37.uni-trier.de  Wed Jan 21 00:57:45 1998
Received: from sliphost37.uni-trier.de (sliphost37.uni-trier.de [136.199.240.37])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA05827
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 21 Jan 1998 00:57:42 -0800 (PST)
          (envelope-from blank@sliphost37.uni-trier.de)
Received: (from blank@localhost)
	by sliphost37.uni-trier.de (8.8.8/8.8.8) id JAA00400;
	Wed, 21 Jan 1998 09:53:28 +0100 (CET)
	(envelope-from blank)
Message-Id: <199801210853.JAA00400@sliphost37.uni-trier.de>
Date: Wed, 21 Jan 1998 09:53:28 +0100 (CET)
From: Sascha.Blank@sliphost37.uni-trier.de (blank@fox.uni-trier.de)
Reply-To: blank@fox.uni-trier.de
To: FreeBSD-gnats-submit@freebsd.org
Subject: /var/run is not cleaned properly in 2.2.5-RELENG
X-Send-Pr-Version: 3.2

>Number:         5535
>Category:       conf
>Synopsis:       /var/run is not cleaned properly on system startup in 2.2.5-RELENG
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    steve
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 21 01:00:00 PST 1998
>Closed-Date:    Sun Feb 1 09:35:01 PST 1998
>Last-Modified:  Sun Feb  1 09:35:36 PST 1998
>Originator:     Sascha Blank
>Release:        FreeBSD 2.2.5-STABLE i386
>Organization:
>Environment:

A very recent FreeBSD 2.2.5-STABLE system, the file /etc/rc has the version

/etc/rc:
     $Id: rc,v 1.104.2.29 1997/12/09 10:05:04 danny Exp $

The problem may be present in 3.0-CURRENT as well, so one should check
that out too.

>Description:

Every time the system is brought up /etc/rc removes all files in
/var/run.  This causes no problem unless you have a port like
xemacs-20.3 that creates a directory under /var/run (in this case
/var/run/xemacs). So every time rc runs the command

	rm -f /var/run/*

I get the error message

	rm: /var/run/xemacs: is a directory

>How-To-Repeat:

Create a directory under /var/run and wait for the error message while
/etc/rc is processed.

>Fix:

This small diff replaces the 'rm' call with a better suited 'find' call.

*** rc.ctm	Wed Jan 21 09:34:08 1998
--- rc	Wed Jan 21 09:35:05 1998
***************
*** 98,104 ****
  
  adjkerntz -i
  
! rm -f /var/run/*
  
  # Keep a copy of the boot messages around
  dmesg > /var/run/dmesg.boot
--- 98,104 ----
  
  adjkerntz -i
  
! find /var/run -type f -exec rm -f {} \;
  
  # Keep a copy of the boot messages around
  dmesg > /var/run/dmesg.boot

--
             Sascha Blank            | "I prefer to work behind the scenes. The
   Student and System Administrator  | reward is nearly as great,  and the risk
 at the University of Trier, Germany | is far far less" - Ambassador Mollari in
    mailto:blank@fox.uni-trier.de    | in Babylon 5, "The coming of shadows"
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Sun Feb 1 09:35:01 PST 1998 
State-Changed-Why:  
Duplicate of 5619. 
>Unformatted:
