Subject: Re: Cosmetic changes to rc.d scripts
To: Julio M. Merino Vidal <jmmv@menta.net>
From: Greywolf <greywolf@starwolf.com>
List: tech-userlevel
Date: 10/12/2004 13:08:14
[Thus spake Julio M. Merino Vidal ("JMMV: ") 9:30pm...]

JMMV: The first one is the addition of a "comment" variable; this holds a string
JMMV: describing the purpose of the service handled by the rc.d script.
JMMV: This comment is used in start/stop messages instead of the daemon name.
JMMV: I think this is useful because you can see what's going on more easily;
JMMV: specially, it will make novice's life easier (less criptic stuff).

[as long as veterans are not treated as novices...]

JMMV:
JMMV: For example, the inetd script includes 'comment="Internet superserver"',
JMMV: so that, instead of "Starting inetd.", you'll see "Starting Internet
JMMV: superserver (inetd)."  (yeah, the real name is kept at the end).
JMMV:
JMMV: The changes I've done make the comment variable optional, so that old
JMMV: scripts (those installed from pkgsrc, for example, don't break until they
JMMV: are convered).

I'd like to see the full name kept optional, i.e. print_extname=NO, in
case some of us don't like to see our systems looking "dumbed down".

[Personally, I don't think this change should be going in at all, but
I'm trying to more carefully choose my battles.  I'm not really enamored
of Linux ANYTHING, much less the thought of integrating it into NetBSD.]

JMMV: The second change is the addition of a prefix to "important" messages.
JMMV: For example, consider the dhclient script: a typical run shows a
JMMV: "Starting dhclient." message followed by the output of the command.  This
JMMV: is confusing, because it's hard to associate all that output to a given
JMMV: rc.d script (ok, ok, in this case it's easy, but there are other situations
JMMV: where it's not).
JMMV:
JMMV: Adding a prefix to the start/stop messages, you can think of the output
JMMV: as several "groups".  Ideally, each script should print a single prefixed
JMMV: message at the very beginning, followed by multiple extra non-prefixed
JMMV: messages.  For example, in the previous case you'd see "=> Starting DHCP
JMMV: client (dhclient)." followed by all dhclient messages.  In this case, you
JMMV: can easily see that all extra information belongs to the dhclient script
JMMV: because it's in a "subsection".

I'd say it would make more sense to have them output as

$scriptname: $prog_output

i.e.

dhclient: no /etc/dhclient.conf
dhclient: aborting


or some such, so it's unambiguous as from whence the output comes.

JMMV: What do you think about this?

Well, that was my two bucks' worth.

				--*greywolf;
--
"We have discovered a bug in System V: the OS itself."