From nobody@FreeBSD.org  Wed Sep 12 04:26:12 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 3948B37B405
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 12 Sep 2001 04:26:12 -0700 (PDT)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.4/8.11.4) id f8CBQC685339;
	Wed, 12 Sep 2001 04:26:12 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200109121126.f8CBQC685339@freefall.freebsd.org>
Date: Wed, 12 Sep 2001 04:26:12 -0700 (PDT)
From: Jess Arniz <jesus@0z0ne.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: rc files creation problem
X-Send-Pr-Version: www-1.0

>Number:         30520
>Category:       conf
>Synopsis:       rc files creation problem
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 12 04:30:00 PDT 2001
>Closed-Date:    Sun Jan 13 16:08:22 PST 2002
>Last-Modified:  Sun Jan 13 16:10:01 PST 2002
>Originator:     Jess Arniz
>Release:        4.0, 4.2 and 4.4 tested
>Organization:
>Environment:
FreeBSD 0z0ne.com 4.0-RELEASE FreeBSD 4.0-RELEASE #0: Tue Dec 26 13:16:58 CET 2000     
>Description:
When you use /stand/sysinstall to add or remove a daemon from the boot of the system (and may be configuring other rc files also) it adds new lines without deleting the previous one.

An example:
--rc.conf-----
# -- sysinstall generated deltas -- #
# Created: Tue Sep  4 20:28:36 2001
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
kern_securelevel_enable="NO"
keymap="spanish.iso.acc"
nfs_reserved_port_only="YES"
sendmail_enable="YES"
sshd_enable="YES"
usbd_enable="YES"
# -- sysinstall generated deltas -- #
ifconfig_xl0="inet 172.27.100.51  netmask 255.255.252.0"
defaultrouter="172.27.100.1"
tcp_extensions="YES"
hostname="mordor.ofi.adm"
# -- sysinstall generated deltas -- #
inetd_enable="NO"
# -- sysinstall generated deltas -- #
sendmail_enable="NO"
---

As you can see I have two "sendmail_enable="NO"".
>How-To-Repeat:
Using /stand/sysinstall and Enabling and Disabling a Service (and other rc configuration).
>Fix:
I think you should do something like....

cat $RCFILE | grep -v "$LINETOADD" > tmp
mv tmp $RCFILE
echo "$LINETOADD" >> $RCFILE

Regards!
>Release-Note:
>Audit-Trail:

From: Peter Pentchev <roam@ringlet.net>
To: =?windows-1251?Q?Jes=FAs_Arn=E1iz?= <jesus@0z0ne.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: conf/30520: rc files creation problem
Date: Wed, 12 Sep 2001 14:19:51 +0300

 On Wed, Sep 12, 2001 at 04:26:12AM -0700, Jess Arniz wrote:
 > 
 > >Number:         30520
 > >Category:       conf
 > >Synopsis:       rc files creation problem
 > >Organization:
 > >Environment:
 > FreeBSD 0z0ne.com 4.0-RELEASE FreeBSD 4.0-RELEASE #0: Tue Dec 26 13:16:58 CET 2000     
 > >Description:
 > When you use /stand/sysinstall to add or remove a daemon from the boot of the system (and may be configuring other rc files also) it adds new lines without deleting the previous one.
 [snip]
 > 
 > As you can see I have two "sendmail_enable="NO"".
 
 I do not really think this should be considered a problem.
 The way sysinstall works allows you to view the whole history of
 its editing the rc.conf file, and lets you very easily restore
 old configurations (esp. program flags, where every single letter
 matters ;)
 
 Yes, this adds to the size of the rc.conf file, but the history kept
 is much helpful sometimes..
 
 G'luck,
 Peter
 
 -- 
 I've heard that this sentence is a rumor.

From: "Jesus Arnaiz" <jesus@pasapues.com>
To: "Peter Pentchev" <roam@ringlet.net>,
	"Jesus Arnaiz" <jesus@0z0ne.com>
Cc: <freebsd-gnats-submit@FreeBSD.org>
Subject: RE: conf/30520: rc files creation problem
Date: Wed, 12 Sep 2001 14:05:22 +0200

 Ok, I understand.
 
 The problem is the system reads all the configuration files when it boots,
 and if rc.files grows your system boots delay a little. But as you say is
 not a really problem.
 
 Regards.
 
 --
 Jesus Arnaiz.
 
 > -----Mensaje original-----
 > De: Peter Pentchev [mailto:roam@ringlet.net]
 > Enviado el: miercoles, 12 de septiembre de 2001 13:20
 > Para: Jess Arniz
 > CC: freebsd-gnats-submit@FreeBSD.org
 > Asunto: Re: conf/30520: rc files creation problem
 >
 >
 > On Wed, Sep 12, 2001 at 04:26:12AM -0700, Jess Arniz wrote:
 > >
 > > >Number:         30520
 > > >Category:       conf
 > > >Synopsis:       rc files creation problem
 > > >Organization:
 > > >Environment:
 > > FreeBSD 0z0ne.com 4.0-RELEASE FreeBSD 4.0-RELEASE #0: Tue Dec
 > 26 13:16:58 CET 2000
 > > >Description:
 > > When you use /stand/sysinstall to add or remove a daemon from
 > the boot of the system (and may be configuring other rc files
 > also) it adds new lines without deleting the previous one.
 > [snip]
 > >
 > > As you can see I have two "sendmail_enable="NO"".
 >
 > I do not really think this should be considered a problem.
 > The way sysinstall works allows you to view the whole history of
 > its editing the rc.conf file, and lets you very easily restore
 > old configurations (esp. program flags, where every single letter
 > matters ;)
 >
 > Yes, this adds to the size of the rc.conf file, but the history kept
 > is much helpful sometimes..
 >
 > G'luck,
 > Peter
 >
 > --
 > I've heard that this sentence is a rumor.
 >
 

From: Peter Pentchev <roam@ringlet.net>
To: Jesus Arnaiz <jesus@pasapues.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: conf/30520: rc files creation problem
Date: Wed, 12 Sep 2001 15:05:02 +0300

 On Wed, Sep 12, 2001 at 02:05:22PM +0200, Jesus Arnaiz wrote:
 > Ok, I understand.
 > 
 > The problem is the system reads all the configuration files when it boots,
 > and if rc.files grows your system boots delay a little. But as you say is
 > not a really problem.
 
 Well, let's see.  On a 4.4-RC system, cvsup'd and rebuilt today..
 
 [root@ringworld:v2 /etc]# wc -l rc*
      724 rc
      217 rc.atm
       81 rc.conf
        4 rc.conf.local
       39 rc.devfs
      133 rc.diskless1
       82 rc.diskless2
      293 rc.firewall
      276 rc.firewall6
       68 rc.i386
       96 rc.isdn
      794 rc.network
      496 rc.network6
       56 rc.pccard
       46 rc.resume
      153 rc.serial
       96 rc.shutdown
       50 rc.suspend
      203 rc.syscons
       45 rc.sysctl
     3952 total
 [root@ringworld:v2 /etc]#
 
 My rc.conf and rc.conf.local come up to just about 2.5% of the system
 rc scripts :)  The five-to-ten lines added by sysinstall (and sometimes
 those are even fewer than five) would only add 0.2% "overhead"; things
 do not seem all that bad, IMHO.. :)
 
 G'luck,
 Peter
 
 -- 
 This sentence is false.
State-Changed-From-To: open->feedback 
State-Changed-By: bmah 
State-Changed-When: Fri Jan 11 22:41:01 PST 2002 
State-Changed-Why:  
Discussion in the audit trail implies that this isn't really 
a problem.  Is it OK to close this PR? 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=30520 
State-Changed-From-To: feedback->closed 
State-Changed-By: bmah 
State-Changed-When: Sun Jan 13 16:08:22 PST 2002 
State-Changed-Why:  
Submitter agrees this isn't really a problem. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=30520 

From: bmah@freebsd.org (Bruce A. Mah)
To: bug-followup@freebsd.org
Cc:  
Subject: Re: conf/30520: rc files creation problem 
Date: Sun, 13 Jan 2002 16:07:09 -0800

 For the audit trail:
 
 If memory serves me right, jesus@0z0ne.com wrote:
 > 
 > Yes, I would like to have two different "rc" files, a history which let's
 > you know what configuration you have had in the past (even better if it
 > includess dates), and the one you are usign without repeated lines. But as
 > it have been said in this thread it is not a real problem.
 
 
>Unformatted:
