From blank@sliphost37.uni-trier.de  Sun Feb  1 01:19:34 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 BAA12550
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 1 Feb 1998 01:19:32 -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 KAA00335;
	Sun, 1 Feb 1998 10:15:22 +0100 (CET)
	(envelope-from blank)
Message-Id: <199802010915.KAA00335@sliphost37.uni-trier.de>
Date: Sun, 1 Feb 1998 10:15:22 +0100 (CET)
From: blank@fox.uni-trier.de (Sascha Blank)
Reply-To: blank@fox.uni-trier.de (Sascha Blank)
To: FreeBSD-gnats-submit@freebsd.org
Subject: /etc/rc doesn't clean /var/run properly
X-Send-Pr-Version: 3.2

>Number:         5619
>Category:       bin
>Synopsis:       /etc/rc doesn't clean /var/run properly
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb  1 01:20:01 PST 1998
>Closed-Date:    Tue Jun 2 04:02:51 PDT 1998
>Last-Modified:  Tue Jun  2 04:03:07 PDT 1998
>Originator:     Sascha Blank
>Release:        FreeBSD 2.2.5-STABLE i386
>Organization:
>Environment:

A very recent 2.2.5-STABLE system. The /etc/rc file has the version number:

/etc/rc:
     $Id: rc,v 1.104.2.32 1998/01/29 11:17:44 obrien Exp $

>Description:

During system startup /etc/rc cleans the /var/run directory. This works
well unless you have a port installed like xemacs-20.3 that creates a
subdirectory under /var/run (in this case /var/run/xemacs/lock). Because
of this I get the error message 

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

every time /etc/rc is processed.

>How-To-Repeat:

Create a directory under /var/run and watch for the message as /etc/rc
is processed.

>Fix:

This small diff fixes the problem by replacing the rm command with a
more appropriate find-rm combination.

*** /usr/src/etc/rc	Fri Jan 30 17:19:36 1998
--- /etc/rc	Sun Feb  1 10:07:09 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:

From: Hans Petter Bieker <hanspb@persbraten.vgs.no>
To: Sascha Blank <blank@fox.uni-trier.de>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/5619: /etc/rc doesn't clean /var/run properly
Date: Sun, 1 Feb 1998 12:16:44 +0100 (CET)

 On Sun, 1 Feb 1998, Sascha Blank wrote:
 
 > ! find /var/run -type f -exec rm -f {} \;
 
 Which is wrong. Why do you want fifos etc to stay?
 
 -bieker-
 

From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To: blank@fox.uni-trier.de
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/5619: /etc/rc doesn't clean /var/run properly
Date: Sun, 1 Feb 1998 16:39:13 +0100 (CET)

 Same here with sudo (look at misc/4723 :-(). I was told 
 that sudo is not allowed to create directories there and
 should go to /var/db. However I am using now:
 
 (cd /var/run && { rm -rf -- *; cp /dev/null utmp; chmod 644 utmp; })
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Tue Jun 2 04:02:51 PDT 1998 
State-Changed-Why:  
fixed in current 
>Unformatted:
