Re: should an init-script print output, if verbose is set to no in /etc/default/rcS or by /lib/init/vars.sh?

2007-04-28 Thread Steve Langasek
On Sat, Apr 28, 2007 at 11:23:28PM +0200, Marc Haber wrote:
> On Wed, 18 Apr 2007 03:17:43 -0700, Steve Langasek <[EMAIL PROTECTED]>
> wrote:
> >Further, why should individual init scripts that are already going to all
> >the effort of using the LSB interfaces be expected to handle VERBOSE
> >individually?  Why isn't this part of the log_* implementation?

> The LSB init script stuff is a red herring anyway since the Interface
> is badly designed and utterly incomplete. Init scripts are therefore
> forced to abuse the provided functions if something "special" is
> needed.

I agree that it's badly designed, but when so many packages are using the
Debian LSB init script functions *anyway*, why should each of these packages
be expected to individually implement a 'quiet' mode when this is clearly
something that the log_* functions should do already?

-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
[EMAIL PROTECTED]   http://www.debian.org/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: should an init-script print output, if verbose is set to no in /etc/default/rcS or by /lib/init/vars.sh?

2007-04-28 Thread Russ Allbery
Marc Haber <[EMAIL PROTECTED]> writes:
> Steve Langasek <[EMAIL PROTECTED]> wrote:

>> Further, why should individual init scripts that are already going to
>> all the effort of using the LSB interfaces be expected to handle
>> VERBOSE individually?  Why isn't this part of the log_* implementation?

> The LSB init script stuff is a red herring anyway since the Interface is
> badly designed and utterly incomplete. Init scripts are therefore forced
> to abuse the provided functions if something "special" is needed.

Is there any way that we can fix this?  I *really* like the basic idea and
would be quite happy to never again write an "echo -n" in an init script.
Getting all of the output right to look reasonable even in a pure text
interface is kind of a pain, and I can definitely see why different people
may prefer different output formats for the boot messages.  But the
current provided functions have some significant issues.

To take one of the most obvious, they don't deal with failure at all well.
If you try to start something and it fails with an error message, you end
up with the error message plastered after the starting message without any
blank line (and therefore often going over 80 columns), then a newline and
a space, and then the failed message.

They also don't deal at all well with programs that produce console output
when they start (fairly common when loading kernel modules, for instance).
I need some way to tell the output system that I'm about to do something
that's going to produce output and they should do something reasonable
with the formatting rather than just tack it on to the end of whatever
line happens to be on the screen.

And maybe it's just me, but having a library of convenience functions
that, if used according to directions, end up having you write code like
this seems rather silly:

[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start_kdc
case "$?" in
  0|1)
if [ "x$RUN_KRB524D" = "xtrue" ] ; then
[ "$VERBOSE" != no ] && log_progress_msg "krb524d"
do_start_krb524d
case "$?" in
  0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
  2)   [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
else
[ "$VERBOSE" != no ] && log_end_msg 0
fi
;;
  2)
[ "$VERBOSE" != no ] && log_end_msg 1
;;

Surely the library should be dealing with some of this sort of thing.

I don't have any time at all to work on this personally, but I'm happy to
send this somewhere as a bug report or something if it would be helpful
and I'll gladly cheer on someone else who wants to tackle this!

I've been pushing back on having lintian warn when the LSB functions
aren't used precisely because things like this mean that I'm not at all
convinced they're an improvement.  I think that if these issues were
addressed, they *would* be an improvement, and there are some significant
benefits to be gained from running everything through a central set of
functions for exactly the same reasons that we do the same thing with
package installation prompting and debconf.

-- 
Russ Allbery ([EMAIL PROTECTED])   


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: should an init-script print output, if verbose is set to no in /etc/default/rcS or by /lib/init/vars.sh?

2007-04-28 Thread Warren Turkal
On Saturday 28 April 2007 15:23, Marc Haber wrote:
> The LSB init script stuff is a red herring anyway since the Interface
> is badly designed and utterly incomplete. Init scripts are therefore
> forced to abuse the provided functions if something "special" is
> needed.

Could you elaborate on this thought? It may be useful to think about for 
extending the LSB semantics and rolling them into the standard.

wt
-- 
Warren Turkal


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: should an init-script print output, if verbose is set to no in /etc/default/rcS or by /lib/init/vars.sh?

2007-04-28 Thread Marc Haber
On Wed, 18 Apr 2007 03:17:43 -0700, Steve Langasek <[EMAIL PROTECTED]>
wrote:
>Further, why should individual init scripts that are already going to all
>the effort of using the LSB interfaces be expected to handle VERBOSE
>individually?  Why isn't this part of the log_* implementation?

The LSB init script stuff is a red herring anyway since the Interface
is badly designed and utterly incomplete. Init scripts are therefore
forced to abuse the provided functions if something "special" is
needed.

Greetings
Marc

-- 
-- !! No courtesy copies, please !! -
Marc Haber |   " Questions are the | Mailadresse im Header
Mannheim, Germany  | Beginning of Wisdom " | http://www.zugschlus.de/
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 621 72739834



Re: should an init-script print output, if verbose is set to no in /etc/default/rcS or by /lib/init/vars.sh?

2007-04-18 Thread Steve Langasek
On Tue, Apr 17, 2007 at 06:31:35PM +0200, Christian Perrier wrote:
> Quoting Petter Reinholdtsen ([EMAIL PROTECTED]):

> > [Evgeni Golov]
> > > Now my question to the init-gurus/maintainers is: is the behavior of
> > > my script correct, or should verbose mean: "print minimal status
> > > information, but suppress warnings etc"?

> > I would recommend only printing warning and error messages when
> > VERBOSE is disabled, so in this regard you script sounds correct.

> And, speaking for the samba package maintainers and as the person who,
> IIRC, reported the suggestion to use LSB stuff for openssh, I can tell
> that not using VERBOSE is nothing but ignorance on my side.

And where in policy are all of these requirements documented?

Further, why should individual init scripts that are already going to all
the effort of using the LSB interfaces be expected to handle VERBOSE
individually?  Why isn't this part of the log_* implementation?

Also, why is /lib/init/vars.sh not set +e-clean?

-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
[EMAIL PROTECTED]   http://www.debian.org/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: should an init-script print output, if verbose is set to no in /etc/default/rcS or by /lib/init/vars.sh?

2007-04-17 Thread Christian Perrier
Quoting Petter Reinholdtsen ([EMAIL PROTECTED]):
> 
> [Evgeni Golov]
> > Now my question to the init-gurus/maintainers is: is the behavior of
> > my script correct, or should verbose mean: "print minimal status
> > information, but suppress warnings etc"?
> 
> I would recommend only printing warning and error messages when
> VERBOSE is disabled, so in this regard you script sounds correct.


And, speaking for the samba package maintainers and as the person who,
IIRC, reported the suggestion to use LSB stuff for openssh, I can tell
that not using VERBOSE is nothing but ignorance on my side.

/me runs to change the samba init script..:)




signature.asc
Description: Digital signature


Re: should an init-script print output, if verbose is set to no in /etc/default/rcS or by /lib/init/vars.sh?

2007-04-17 Thread Michal Čihař
Hi

On Tue, 17 Apr 2007 14:31:51 +0200
Evgeni Golov <[EMAIL PROTECTED]> wrote:

> an user reported in #419413, that my init-script does no output, if
> VERBOSE is set to no. He also gave examples (ssh, openbsd-initd, samba)
> of packages, who ignore the verbose-setting and do some output with
> "echo" or "log_*" from lsb-base, what he thinks is "normal".
> But there are also packages who act exactly as /etc/init.d/skeleton
> and call log_* only if VERBOSE!=no.
> 
> The Debian policy (9.3, 9.4) does not really say, that a init-script
> MUST have output, but only defines how the output should look like and
> refers to skeleton for the usage.

And skeleton currently prints something only when VERBOSE!=no...

-- 
Michal Čihař | http://cihar.com | http://blog.cihar.com


signature.asc
Description: PGP signature


Re: should an init-script print output, if verbose is set to no in /etc/default/rcS or by /lib/init/vars.sh?

2007-04-17 Thread Petter Reinholdtsen

[Evgeni Golov]
> Now my question to the init-gurus/maintainers is: is the behavior of
> my script correct, or should verbose mean: "print minimal status
> information, but suppress warnings etc"?

I would recommend only printing warning and error messages when
VERBOSE is disabled, so in this regard you script sounds correct.

Friendly,
-- 
Petter Reinholdtsen
one of the sysvinit maintainers. :)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]