Subject: Re: ipmon does not start as daemon
To: Andrew Brown <atatat@atatdot.net>
From: Greg A. Woods <woods@weird.com>
List: current-users
Date: 02/27/2002 14:33:24
[ On Wednesday, February 27, 2002 at 14:16:38 (-0500), Andrew Brown wrote: ]
> Subject: Re: ipmon does not start as daemon
>
> >> >The version in -current now has '-D' now too, but unfortunately
> >> >etc/rc.d/ipmon has not yet been fixed to use it explicitly....
> >> 
> >> what do you mean?  the -D flag was added to ipmon_flags in
> >> /etc/defaults/rc.conf last july, so there's no need for "explicit" use
> >> of it.
> >
> > I mean that's the wrong way to use it.  Obviously there's been an
> > problem with people not including '-D' in their own /etc/rc.conf
> > settings, and if you think about it for a tiny wee moment longer you'll
> > hopefully realise that in the way /etc/rc.d/ipmon invokes 'ipmon' the
> > '-D' will _ALWAYS_ be absolutely required, and therefore the correct
> > solution is to explicitly use '-D' in that invocation (and to not rely
> > on admins keeping it in their /etc/rc.conf settings)!
> 
> that line of reasoning leads to believing that *all* the settings in
> /etc/defaults/rc.conf should be set in the binaries, and only be able
> to be turned *off* through the use of flags.

No, it clearly does not.  You're not _THINKING_ about it!  Stop and
_THINK_ about all the aspects of this issue and hopefully you'll begin
to see the true line of reasoning I'm trying to show you.

Here are some more hints:

1. Previously to the addition of '-D', the '&' operator was used
   explicilty to put "ipmon" into the background and to simulate making
   it into a daemon.  The '&' did not have to be specified in
   /etc/rc.conf (or defaulted in /etc/defaults/rc.conf)

2. /etc/rc.d scripts expect to start programs that either complete, or
   which turn themselves into daemons automatically.  If "ipmon" were
   written in the true *BSD style it would likely be called "ipmond" and
   it would require a command-line flag to _prevent_ it from becoming a
   daemon.  However "ipmon" as it is has been written in the SysV style
   so that it can be started and monitored and restarted if it fails by
   /etc/init.  So, as it is, it _MUST_ have the '-D' flag given to it
   when it's used in a *BSD-way.

3. requiring the user to copy and maintain the use of a flag from
   /etc/defaults/rc.conf to /etc/rc.conf, a flag that will always 100%
   be absolutely required, violates all other expectations set for the
   ${name}_flags variables used in rc.conf!

-- 
								Greg A. Woods

+1 416 218-0098;  <gwoods@acm.org>;  <g.a.woods@ieee.org>;  <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>