Bug#660790: lsb-base: log_warning_msg does not respect leading spaces;
tags patch
On Wed, Mar 07, 2012 at 11:21:37AM +0100, Didier 'OdyX' Raboud wrote:
> tags 660790 +wontfix
> thanks
>
> Hi Luca, and thanks for your bugreport,
>
> Le 21.02.2012 22:42, Luca Capello a écrit :
> >
> > As you can see, the leading space is not respected. I think this is
> > because log_warning_msg calls log_begin_msg, which actually uses
> > `/bin/echo -n "$@"` instead of adding a leading space before $@, as in
> > log_progress_msg. The latter is IMHO more correct, given that there is
> > no *begin* message to be displayed.
> >
> > However, this breaks other init scripts like rsync:
> >
> > --8<---------------cut here---------------start------------->8---
> > 120 reload|force-reload)
> > 121 log_warning_msg "Reloading rsync daemon: not needed, as the daemon"
> > 122 log_warning_msg "re-reads the config file whenever a client connects."
> > 123 ;;
> > --8<---------------cut here---------------end--------------->8---
> >
> > So I do not really how this should be solved :-(
>
> As is documented in lsb-base's README.Debian:
>
> > This package also includes the LSB-specified logging functions:
> >
> > log_success_msg message
> > log_failure_msg message
> > log_warning_msg message
> >
> > These functions *do not* comply with Debian policy and should only be
> > used by LSB packages.
>
> So, openvpn (and rsync probably), should rather use the
> log_action_begin_msg / log_action_end_msg pair (or the log_action_msg)
> instead of those.
>
> Hence tagging as "wontfix" as the documentation explicitly recommends
> against using those functions. Now, this makes me wonder about
> investigating and mass-filing bugs against init scripts making use of
> them. Doh.
>
> I hope this gives a honest answer to your bug.
>
> Salutations,
>
> OdyX
>
The fixes are
--- init-functions.jessie 2015-07-09 22:48:06.512304503 +0000
+++ init-functions 2015-07-09 22:49:15.287573358 +0000
@@ -231,21 +231,21 @@ log_use_fancy_output () {
log_success_msg () {
if [ -n "${1:-}" ]; then
- log_begin_msg $@
+ log_begin_msg "$@"
fi
log_end_msg 0
}
log_failure_msg () {
if [ -n "${1:-}" ]; then
- log_begin_msg $@ "..."
+ log_begin_msg "$@" "..."
fi
log_end_msg 1 || true
}
log_warning_msg () {
if [ -n "${1:-}" ]; then
- log_begin_msg $@ "..."
+ log_begin_msg "$@" "..."
fi
log_end_msg 255 || true
}
--
Bjarni I. Gislason
Reply to: