root filesystem not cleanly unmounted on reboot

Bug #952315 reported by Steven Farmer
This bug report is a duplicate of:  Bug #963106: NetworkManager causes orphaned inodes. Edit Remove
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
upstart
Invalid
Undecided
Unassigned
upstart (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

12.04 beta, updated as of 11March2012.

The message "mount: / busy" is seen as the system is shut down. During the reboot, messages from fsck regarding recovery of orphaned inodes are seen in the console. These messages appear in kern.log:

steve@precise:~$ grep -i orphan /var/log/kern.log
Mar 11 09:29:00 precise kernel: [ 12.398913] EXT4-fs (sda1): orphan cleanup on readonly fs
Mar 11 09:29:00 precise kernel: [ 12.399492] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 141316
Mar 11 09:29:00 precise kernel: [ 12.409021] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 267343
Mar 11 09:29:00 precise kernel: [ 12.409450] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 267325
Mar 11 09:29:00 precise kernel: [ 12.410062] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 267319
Mar 11 09:29:00 precise kernel: [ 12.410111] EXT4-fs (sda1): 4 orphan inodes deleted

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: upstart 1.4-0ubuntu8
ProcVersionSignature: Ubuntu 3.2.0-18.28-generic 3.2.9
Uname: Linux 3.2.0-18-generic i686
ApportVersion: 1.94.1-0ubuntu2
Architecture: i386
Date: Sun Mar 11 09:23:29 2012
ExecutablePath: /sbin/init
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release i386 (20111011)
ProcEnviron:
 TERM=linux
 PATH=(custom, no user)
SourcePackage: upstart
UpgradeStatus: Upgraded to precise on 2012-03-02 (8 days ago)

Revision history for this message
Steven Farmer (stevenleefarmer) wrote :
affects: ubuntu → upstart (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in upstart (Ubuntu):
status: New → Confirmed
Revision history for this message
sourchier (sourchier) wrote :

Also seems to affect Oneiric Ocelot. This is the final version AMD 64 bit. Hopefully the shutdown scripts get fixed soon.

Revision history for this message
Steven Farmer (stevenleefarmer) wrote :

Looks to me like there are two separate problems.

The first may be a regression of Bug #672177 for which a fix was supposedly released ca April 2011. Upgrading or re-installing libc6 results in orphaned inodes:

$ sudo apt-get install --reinstall libc6 && sudo shudown -r now

I put '/usr/sbin/lsof -n > /saved.root.lsof' in /etc/init.d/umountroot just before the root filesystem is remounted read-only. The result shows open files of type 'DEL' for several libc .so files. These are probably the files assocated with the orphaned inodes. fsck must be smart enough to know that the files were deleted so it doesn't put anything into /lost+found.

The second problem is the "mount: / is busy" console message on every reboot. The /saved.root.lsof file shows that dhclient is still holding a dhcp lease file open for write when umountroot is invoked. Doing 'sudo killall dhclient' before the reboot eliminates the message. I couldn't find an already opened bug report for this; if someone else could have a try I'd appreciate it.

Both of these problems are probably benign, but before I trust my data to 12.04, I'd certainly like to hear someone smarter than me say so.

Revision history for this message
Steven Farmer (stevenleefarmer) wrote :

I think I understand what's going on now. In looking over /saved.root.lsof more carefully, I see that the DEL libc .so files are also associated with dhclient. And I was just lucky before that dhclient stayed dead long enough for the reboot. It gets respawned, I believe by NetworkManager.

It looks like dhclient is started by NetworkManager with a -pf arg that makes dhclient write his (dhclient's) pid into a file in the directory /var/run/sendsigs.omit.d/. When the system is being brought down, /etc/init.d/sendsigs collects that pid into an "ignore" list, thus declining to kill dhclient. The result is that dhclient has files held open when the system goes down, leading to the "mount: / is busy" console message, and also to orphaned inodes if libc happened to have been updated.

I removed network-manager* and installed wicd-gtk and dependencies. Now I can reinstall libc6 and reboot with *no* busy message and *no* orphaned inodes.

So, IMHO the blame lies with NetworkManager and not with upstart.

Revision history for this message
Steven Farmer (stevenleefarmer) wrote :

I've submitted Bug #963106 against network-manager for this problem. This bug should probably be closed as invalid since it misidentifies the cause as upstart.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Steven thanks for all the awesome debugging work. Usually we'd just redirect this bug to NetworkManager.. but since you've opened such a nice report over there I'll close this one *and* markt it as a duplicate of yours.

Changed in upstart (Ubuntu):
status: Confirmed → Invalid
Changed in upstart:
status: New → Invalid
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.