Subject: Re: rc.d
To: NetBSD Userlevel Technical Discussion List <tech-userlevel@netbsd.org>
From: Greywolf <greywolf@starwolf.com>
List: tech-userlevel
Date: 03/17/2000 00:08:30
On Fri, 17 Mar 2000, Greg A. Woods wrote:

# [ On Thursday, March 16, 2000 at 11:00:22 (-0800), Greywolf wrote: ]
# > Subject: Re: rc.d
# >
# > But I *like* the pkg system.  It saves me *time*.  Yes, I know how to
# > configure things, and yes I know how to just do format/boot/untar/
# > "edit /etc/*".  In most cases it's faster.
# 
# While saving time is good, the real benefit of the pkg is that it's good
# housekeeping and much closer to proper systems configuration management
# (which of course ultimately saves even more time, long run).

Greg, you're up WAY too late again. :-)

The benefits I see to pkg*:

	- registration of packages and their dependencies
	- saves time when rebuilding binaries to match current kernel/
	  lib setup (especially nice when a.out -> elf happened (SPARC,
	  IA32).

The benefits I see to /etc/rc.d:

The benefits I see to /etc/rc.d with a naming convention a la SysV
[all that [KS][0-9]+ crap]:

What we're trying to achieve could be done, I bet, with a different
approach which would preserve our current rc while allowing the
starting/stopping of individual services.

I came up with something that jumped through quite a few hoops in
order to do things correctly.  Yes, its first move was to source
/etc/rc.conf.  Yes, it depended heavily on what it found in /var/run.
I probably could have made it depend upon what it found in ps, to
a degree.

One thing I could see doing was to echo the command to be run to
/var/run/${command}.cmd, thus resulting in a (.pid, .cmd) pair. If one
wished to restart, one would kill the pid and then run the command found in
the .cmd file.  A 'stop' would kill the pid and delete the .cmd file.
A 'start' would, through some magic, arrive at the right command
and args and run it.

This could be made to work.  One could even inject stuff into /etc/rc,
although my method for doing that is admittedly considered fragile by
a few people, but not off by much in comparison to /etc/rc.d/some-funky-
script-name-with-lame-ascii-ordering.

There's gotta be a better way.  Shoehorning it in amid much dissent in
an incomplete discussion was a very rude thing to do.

# -- 
# 							Greg A. Woods
# 
# +1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
# Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>
# 


				--*greywolf;
--
NetBSD, Net Improvement.