log_progress_msg overridden with empty function in /etc/lsb-base-logging.sh

Bug #282638 reported by mc5686
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
lsb (Ubuntu)
Triaged
Wishlist
Unassigned

Bug Description

Binary package hint: lsb-base

The functions in /etc/lsb-base-logging.sh override all the corresponding functions in /lib/lsb/init-functions.
In particular it override log_progress_msg with the following code:
===========
...
 log_progress_msg () {
    :
}
...
===========

There is really little surprise in the fact no output is given.
Is this behavior intended?
If so: why?
fixing this is rather trivial, bu I would like to understand the "why" before touching anything

If that's relevant:
===========
mauro@heimdall:~$ lsb_release -rd
Description: Ubuntu 8.04.1
Release: 8.04
mauro@heimdall:~$ apt-cache policy lsb-base
lsb-base:
  Installato: 3.2-4ubuntu1
  Candidato: 3.2-4ubuntu1
  Tabella versione:
 *** 3.2-4ubuntu1 0
        500 http://it.archive.ubuntu.com hardy/main Packages
        100 /var/lib/dpkg/status
===========

UPDATE:
I changed my /etc/lsb-base-logging.sh to "fix" the problem (if any).
If someone is interested these are the diffs:
===========
mauro@heimdall:/etc$ diff -wu lsb-base-logging.sh-orig lsb-base-logging.sh
--- lsb-base-logging.sh-orig 2007-09-06 19:43:32.000000000 +0200
+++ lsb-base-logging.sh 2008-10-14 10:55:05.000000000 +0200
@@ -87,6 +87,7 @@
      COLS=80
             COL=73
         fi
+ if [ -n "$2" ]; then #normal case
         # We leave the cursor `hanging' about-to-wrap (see terminfo(5)
         # xenl, which is approximately right). That way if the script
         # prints anything then we will be on the next line and not
@@ -99,6 +100,13 @@
         # asterisk ought to go.

         printf " * $* "
+ unset DO_PROGRESS
+ else #prepare for log_progress_msg
+ printf " * $1"
+ $TPUT sc
+ printf " "
+ DO_PROGRESS='t'
+ fi
         # Enough trailing spaces for ` [fail]' to fit in; if the message
         # is too long it wraps here rather than later, which is what we
         # want.
@@ -111,7 +119,24 @@
 }

 log_progress_msg () {
- :
+ if [ -n $DO_PROGRESS ]; then
+ $TPUT rc
+ printf " $*"
+ $TPUT sc
+ printf " "
+ $TPUT hpa `$EXPR $COLS - 1`
+ printf ' '
+ fi
+}
+
+log_progress_msg1 () {
+ if [ -n $DO_PROGRESS ]; then
+ $TPUT rc
+ printf " $*"
+ $TPUT el
+ $TPUT hpa `$EXPR $COLS - 1`
+ printf ' '
+ fi
 }

 log_end_msg () {
===========
They appear to work correctly at least within gnome-terminal and at the linux console.

TiA
ZioNemo

mc5686 (mc5686)
description: updated
Revision history for this message
Kees Cook (kees) wrote :

Progress reporting is handled via usplash, so this function has been stubbed out. It might make sense to rearrange things to call progress via the lsb scripts and detect usplash like the others do.

Changed in lsb:
importance: Undecided → Wishlist
status: New → Confirmed
Daniel Hahler (blueyed)
Changed in lsb (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
James Baxter (j.w.baxter) wrote :

Also noted in Ubuntu Server 13.04

Revision history for this message
Andrew (radamanf) wrote :

Still is in Ubuntu 14.04

Revision history for this message
Andrew (radamanf) wrote :

14.04 this time it's directly in /lib/lsb/init-functions.d/50-ubuntu-logging

about line 86
log_progress_msg () {
    :
}

It's so difficult to fix Canonical ?? If you want to use your function call it from there then why is this ":" in body ??? to track how many users will complain about this and do some statistics? Who you are working for?

Revision history for this message
Andrew (radamanf) wrote :

ok sorry I think that this is static, but should be a progress .. it's not simple then, but anyway for me I've used this code as static text to see at least some output and not to kill script in the middle of execution:

log_progress_msg () {
    GREEN=`$TPUT setaf 2`
    NORMAL=`$TPUT op`
    printf " $GREEN*$NORMAL $@" || true
}

Revision history for this message
Dave (deargle) wrote :

Still in Ubuntu 16.04.4 LTS server

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.