[PATCH] two simple errors in /etc/init.d/mountall.sh

Bug #28447 reported by Chris Moore
20
Affects Status Importance Assigned to Milestone
sysvinit (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

1. the test for verbosity is backwards on line 60

2. the 'for' in line 70 splits the mount output into separate words, rather than
lines. this results in each line of output from mount being split over several
log warning messages

The attached patch fixes both of these issues.

Revision history for this message
Chris Moore (dooglus) wrote :

Created an attachment (id=5654)
this patch fixes both problems

Revision history for this message
Matthias Klose (doko) wrote :

the patch makes it less verbose, but only prints the first mount line, not all. was this intended?

Changed in sysvinit:
status: Unconfirmed → Confirmed
Revision history for this message
Chris Moore (dooglus) wrote :

The script as it stood before only output the first mount line if VERBOSE was set to something other than "no", such as "yes".

It looks very much as if the author's intention was to have the script be less verbose if VERBOSE was set to "no", not more verbose, so I switched the sense of the check for $VERBOSE. It seems crazy to have "VERBOSE=no" being the most verbose option.

If the intention is to always output all the mount lines then the test for $VERBOSE should be removed altogether.

VERBOSE is set in /etc/default/rcS by the way.

Revision history for this message
Tobi Vollebregt (tobivollebregt) wrote : patch to fix this originally attached to #29010 (dup of this bug)

This patch splits the output in lines by some hackish interpretation of the mount output. It works fine AFAICS, with one exception: if an error is followed by a mount message they're both shown on one line.

Revision history for this message
Chris Moore (dooglus) wrote : Re: two simple errors in /etc/init.d/mountall.sh

The recent update (initscripts version 2.86.ds1-6ubuntu9) fixes the first part of this bug, but does nothing about the 2nd part.

This code is used:

  for MOUNT_MESSAGE_TO_PRINT in $(echo "$MOUNT_MESSAGES" | egrep -v '(already|nothing was) mounted') ; do
   log_warning_msg $MOUNT_MESSAGE_TO_PRINT
  done

The "for" will pick each *word* from the output of egrep in turn, and print is as a warning message, whereas we want it to pick each line in turn.

Hence the "| while read" in my patch.

Revision history for this message
Tormod Volden (tormodvolden) wrote :

From what I see, the first issue is not fixed in initscripts 2.86.ds1-6ubuntu9:
        if [ "$VERBOSE" != no ]; then # Print only the first line output

which I interpret as: if verbose then print only first line.

Revision history for this message
Chris Moore (dooglus) wrote : Re: [Bug 28447] two simple errors in /etc/init.d/mountall.sh

> which I interpret as: if verbose then print only first line.

Right. ie. "if verbose then print less than if not verbose"

  ver·bose adj.
      Using or containing a great and usually an excessive number of
words; wordy.

Setting verbose should create MORE output, not LESS.

Revision history for this message
Chris Moore (dooglus) wrote :

I'm sorry Tormod. I'm agreeing with you... Yestersay I tried to post this:

  >> The recent update (initscripts version 2.86.ds1-6ubuntu9) fixes the
  >> first part of this bug, but does nothing about the 2nd part.
  >
  > My mistake. The recent update doesn't touch either of the 2 bugs, and
  > is completely unrelated.
  >
  > Sorry.

but it appears that Gmail didn't honour the 'Reply-To:' header in the email I was replying to, and it ended up sending the comment to me, not to Malone.

Revision history for this message
Tormod Volden (tormodvolden) wrote : /dev/.initramfs/usplash_log

In case some developer would be interested, this log shows what it looks like at boot-up. I can confirm that Chris' small patch (the first) resolves the issue.

Revision history for this message
Tormod Volden (tormodvolden) wrote :

The bug has a nice patch since 2 months. Is there anything we can do to help this getting committed?

Revision history for this message
Chris Moore (dooglus) wrote :

I don't think so. I ended up having to give up on ubuntu. Too many bugs like this go unfixed.

Revision history for this message
Sivan Greenberg (sivan) wrote :

Chris, I just now saw your CC to me on this Bug Report, as this bug also bugs me since a couple of months, but was busy to track down and understand, I'll test your patch and see if it fixes the issue. If so I'll try to get the wheel going again to include it.

Revision history for this message
Tormod Volden (tormodvolden) wrote :

With the danger of going off-topic: Chris, don't give up. Ubuntu is much more responsive to bug reports and get more fixed faster than, say, debian.
However, I really wonder, what can be improved in the launchpad/packaging/maintainer system to make these things go smoother. I mean, a clean, non-risk, corrective patch lying untouched for two months, with all kind of freezes now approaching in a "enterprise-ready" release ? (okay, I should take this to the forum instead, sorry)

Revision history for this message
Martin Pitt (pitti) wrote :

 sysvinit (2.86.ds1-6ubuntu21) dapper; urgency=low
 .
   * debian/patches/100_mountall_fix_output.dpatch:
     - Fix the check for verbosity.
     - Fix the output when mounting filesystems to display
       complete lines rather then broken into each word.
     - Thanks to Chris Moore <email address hidden>
     - Malone #28447

Thanks to Sivan!

Changed in sysvinit:
status: Confirmed → Fix Released
Revision history for this message
Tormod Volden (tormodvolden) wrote :

Congratulations to all making this fixed!

However, there is still something that seems backwards:

Before there was nothing displayed in usplash (which I think is preferred behaviour) but all the verbose output displayed in console 8 (and in usplash_log as STATUS lines).

Now, this first line (which seems pretty random, in my case this is a totally unimportant partition) is displayed in usplash, which seems a little ugly. (It also appears on console 8 and in usplash_log as a TEXT line).

If I understand correctly, TEXT appears in usplash, and is created by the log_action_cont_msg function.

The STATUS messages are created by the log_warning_msg function.

I therefore suggest changing the non-verbose behaviour to also use log_warning_msg.

Revision history for this message
Tormod Volden (tormodvolden) wrote : removes the mount output from usplash screen

Actually, no reason it should be a log_warning_msg. It should rather be a log_success_msg, if anything at all. What is the interest of that one first line anyway?

Well, this patch cleans up the usplash screen at least.

Revision history for this message
dorpm (dorpmueller) wrote :

Sounds interesting because my bootprocess gets interrupted by verbose mount output too. But how to apply this patch?

Revision history for this message
Tormod Volden (tormodvolden) wrote :

dorpm, the patch is not valid any longer. The scripts were later changed, and now look different in both 6.06 final and in edgy.

Can you please attach your /dev/.initramfs/usplash_log ?

Revision history for this message
dorpm (dorpmueller) wrote :

Here you are:

TEXT Loading essential drivers...
SUCCESS ok
PROGRESS 1
TIMEOUT 180
TIMEOUT 15
TEXT Mounting root file system...
TIMEOUT 540
TIMEOUT 15
SUCCESS ok
PROGRESS 2
PROGRESS 4
TEXT Reading files needed to boot...
SUCCESS ok
PROGRESS 6
TEXT Setting hostname 'mm-home'...
SUCCESS ok
PROGRESS 8
PROGRESS 10
TEXT Preparing restricted drivers...
SUCCESS ok
PROGRESS 12
TEXT Starting basic networking...
SUCCESS ok
PROGRESS 14
TEXT Starting kernel event manager...
SUCCESS ok
TIMEOUT 360
TEXT Loading hardware drivers...
SUCCESS ok
TIMEOUT 15
PROGRESS 16
PROGRESS 19
TEXT Starting PCMCIA services...
STATUS PCMCIA not present
PROGRESS 21
TEXT Loading manual drivers...
TEXT Trying module lp
SUCCESS ok
TEXT Trying module psmouse
SUCCESS ok
SUCCESS ok
PROGRESS 23
PROGRESS 25
TEXT Activating swap...
SUCCESS ok
TEXT Checking root file system...

Florian

Revision history for this message
Tormod Volden (tormodvolden) wrote :

Florian, since your usplash_log stops at "Checking root file system", I think it is the checking of the root fs that takes so much time that usplash quits, and you get all these messages afterwards.

Revision history for this message
dorpm (dorpmueller) wrote :

Is there a time-dependency?

Unfortunately the log was from a boot process where the root fs was completely checked. But normally there is not much more in the log:

TEXT Checking root file system...
SUCCESS ok
PROGRESS 27
PROGRESS 29
PROGRESS 31
TEXT Checking all filesystems...

At the latest usplash stops here. Is there any chance to change this behaviour?

Florian

Revision history for this message
Tormod Volden (tormodvolden) wrote :

usplash has a timeout, so that if something takes longer than normally expected, the splash screen goes away so that the user can read the messages and see what is going on. Probably you have some filesystems that are slow to check.

I experienced this myself when I had two vfat filesystems in /etc/fstab.

Revision history for this message
dorpm (dorpmueller) wrote :

Here I found something that sounds interesting: http://ubuntuforums.org/archive/index.php/t-75132.html

It seems that the timeout can be changed in /usr/share/initramfs-tools/scripts/init-top/usplash by adding
/sbin/usplash_write "TIMEOUT 60" at the end of the file.

What do you think?

Florian

Revision history for this message
Tormod Volden (tormodvolden) wrote :

Florian, if you do: grep '"TIMEOUT' /etc/init.d/* you'll see that several start-up scripts change the timeout. You can try modifying checkfs.sh if you like.
See bug #22658 for more on this.

Revision history for this message
dorpm (dorpmueller) wrote :

Thanks Tormod, that worked for me!

Florian

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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