Re: Possible fix for rc.conf

1999-03-21 Thread Stephen McKay
On Sunday, 21st March 1999, Richard Wackerbarth wrote:

>Why do we need to have ANY of the file inclusion in /etc/defaults/rc.conf?
>Shouldn't that file simply be definitions of variables?
>IMHO, the "logic" should be in "rc" itself.

Yeah!  What he said!

Having code in rc.conf sucks.  If there is no logic, there can be no
recursion.  If you are going to mix code into rc.conf you may as well
just suck it back into /etc/rc and get rid of it entirely. (*)

Stephen.

(*) Which is silly, of course.


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message



Re: Possible fix for rc.conf

1999-03-21 Thread Richard Wackerbarth
Why do we need to have ANY of the file inclusion in /etc/defaults/rc.conf?
Shouldn't that file simply be definitions of variables?
IMHO, the "logic" should be in "rc" itself.


On Sat, 20 Mar 1999, Scot W. Hetzel wrote:

> What does everyone think about using this at the end of
> /etc/defaults/rc.conf?
> 
> for i in ${rc_conf_files}; do
> if [ $0 != $i ]; then
>  if [ -f $i ]; then
>  . $i
>  fi
> else
> echo "Error: $0 isn't allowed to re-load $i."
> echo "Error: Please do not copy /etc/defaults/rc.conf to
> /etc/rc.conf"
> fi
> done
> 
> If someone does copy the /etc/defaults/rc.conf to /etc/rc.conf, /etc/rc.conf
> will not reload it's self, thus it will never get stuck in an endless loop.



To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message



Re: Possible fix for rc.conf

1999-03-20 Thread Alex Zepeda
On Sat, 20 Mar 1999, Scot W. Hetzel wrote:

> If someone does copy the /etc/defaults/rc.conf to /etc/rc.conf, /etc/rc.conf
> will not reload it's self, thus it will never get stuck in an endless loop.

Oh it's too late for that. :)

- alex



To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message



Re: Possible fix for rc.conf

1999-03-20 Thread Rahul Dhesi
"Scot W. Hetzel"  writes:

>if [ $0 != $i ]; then

A more generic fix is for each script to set an environment variable,
and check to make sure that variable was not set already.  Analogous to
how C include files prevent recursive inclusion.
-- 
Rahul Dhesi 


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message



Possible fix for rc.conf

1999-03-20 Thread Scot W. Hetzel
What does everyone think about using this at the end of
/etc/defaults/rc.conf?

for i in ${rc_conf_files}; do
if [ $0 != $i ]; then
 if [ -f $i ]; then
 . $i
 fi
else
echo "Error: $0 isn't allowed to re-load $i."
echo "Error: Please do not copy /etc/defaults/rc.conf to
/etc/rc.conf"
fi
done

If someone does copy the /etc/defaults/rc.conf to /etc/rc.conf, /etc/rc.conf
will not reload it's self, thus it will never get stuck in an endless loop.

Scot



To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message