Subject: re: /etc/rc.d/ runs slowsly
To: NetBSD-current Discussion List <current-users@netbsd.org>
From: Greywolf <greywolf@starwolf.com>
List: current-users
Date: 04/08/2000 22:44:32
On Sat, 8 Apr 2000, Greg A. Woods wrote:

# [[ note: redirected to current-users ]]
# 
# [ On Saturday, April 8, 2000 at 00:35:15 (+1000), matthew green wrote: ]
# > Subject: re: /etc/rc.d/ runs slowsly 
# >
# > i thought there was a backdoor hack in that boottime used to
# > disable running ps to check if a daemon was already running..
# > did luke not commit this???
# 
# It doesn't look like any fix has yet been committed.
# 
# The "ps -c" trick speeds up PS, but it's not the only problem with the
# rc functions -- "while" loops in shell scripts are also somewhat slow,
# especially if they have to fork 'test' twice on every iteration!  ;-)

What "fork test"?  "test" is a builtin, no?

Don't we have a decent parser anywhere in the root filesystem?

*sigh*.  Here we go.  The beginning of the end.  Now we're gonna need
/usr mounted right away.

This is not acceptable for a BSD.

# WARNING: this patch uses 'fgrep' even though it isn't in /usr/bin.  I
# can get away with this because I keep /usr on my root filesystem (where
# it belongs! :-).

How far are we going to degenerate?  /usr does NOT belong on root.
Run HP-UX or Solaris or maybe IRIX if that's better for you.

# If it's not appropriate to move 'grep' to /bin for the
# sticks-in-the-mud who don't want to move /usr to the root FS, then
# perhaps 'sed' or maybe a really simple stand-alone true fgrep clone
# would be appropriate.  Note that a static 'sed' is only ~87k on i386.
# Personally if I were to keep /usr on a separate FS then I'd want 'awk'
# in /bin too.

pmatch would be good.  I wonder if perhaps a case statement instead of
an if [ ... ] would be better.

				--*greywolf;
--
BSD: safe ports in a storm.