I believe that this problem is caused by the /etc/init.d/sendsigs script
not correctly waiting for terminating Upstart jobs.

I came across this problem on a Maverick system used for MythTV.  One
night it was left to transcode and advert flag a movie (lots of disk
activity) after which it automatically powered off.  The next morning I
turned on the system and /var didn't mount due to errors.

I kept an eye on the system thereafter thinking it was a disk fault but
noticed the same orphaned inode and recovering journal messages on every
restart.  I found in this case that shutting down mysqld in advance of
calling poweroff resolved the problems.  However, that made me look
further and I realised that mysql was only a problem because it took
several seconds or more to shutdown.  It looked like there was a race
condition in the shutdown logic.

On entering runlevel 0 or 6 (halt or reboot), Upstart delivers a TERM
signal to all processes that should stop at that runlevel.  The service
doesn't have to terminate immediately - some services like mysql take a
few seconds to tidy up.  An upstart service can define a kill timeout
stanza to specify a stop time if it's in excess of 5 seconds.  After
this time Upstart will deliver a KILL signal.

The problem is that immediately after Upstart sends the TERM signals it
starts the rc.conf service to run the SystemV scripts in /etc/rc0.d.
One particular script, S20sendsigs, is responsible for TERMinating all
remaining processes.  However, it's logic is to exclude any Upstart job
and so it can exit believing that all processes are dead.  Then
/etc/rc0.d/S40umountfs unmounts the fllesystem while there are open
files and hey-presto orphaned inodes & worse...

The attached patch makes sendsigs wait for any Upstart jobs that are
stopping.  This fixes all my file corruption problems and since using it
I've not had any orphaned inodes.

This has made be question the correctness and safety of umount.  I would
have thought that it should work OK in the presence of open files, but
I'm no ext3 expert.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/616287

Title:
  umountfs doesn't cleanly unmount / on reboot

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to