Your message dated Sat, 21 Apr 2012 00:52:18 +0100
with message-id <[email protected]>
and subject line Close old and unfixable sysvinit bugs
has caused the Debian Bug report #288016,
regarding Please consider adding a shutdown script that releases loop devices
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
288016: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=288016
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: initscripts
Version: 2.86-5
Severity: wishlist

When a loop device is used implicitly by mounting a file with the loop
option, e.g.:
  mount -o loop /path/to/filesystem /mnt
the loop device is automatically released when the filesystem is
unmounted.  However, when a loop device is set up and mounted
manually, e.g.:
  losetup /dev/loop0 /path/to/filesystem
  mount /dev/loop0 /mnt
the device is not automatically released when the filesystem is
unmounted.  It must be manually released:
  losetup -d /dev/loop0

I use the loop device in this way fairly often, but often forget to
release the device after use.  This causes a problem when I shut my
computer down: because the file attached to the loop device is open,
the filesystem in which it resides cannot be cleanly unmounted.

I think that there is a need for a shutdown script that automatically
unmounts and releases all loop devices.  I have appended the script I
use for this purpose.  I installed it as /etc/init.d/releaseloop, and
it is run in runlevels 0 and 6 immediately before umountfs.  I make no
claims about its robustness or suitability for Debian, only that it
Works For Me.

-Stephen

-- 
[[ http://nysa.cx/journal/ ]]

"The only dependable thing about the future is uncertainty."
-- Amarant Coral, Final Fantasy IX


#!/bin/sh

grep >/dev/null 2>&1 loop /proc/devices || exit 0

echo -n 'Releasing loop devices'

# Unmount anything using a loop device -- handles both direct mounts
# (e.g. /dev/loop0 on /mnt), and indirect mounts (a file mounted with
# -o loop).  Mounts are processed in reverse order -- handles loop
# filesystems mounted in directories that are themselves in loop
# filesystems (Corner Case City, Arizona)
filesystems=""
for fs in `grep '^/dev/loop' /proc/mounts | cut -d' ' -f2`
do
  filesystems="$fs $filesystems"
done
for fs in $filesystems
do
  # Expand any escaped characters in $fs
  fs=`printf "$fs\n"`

  umount "$fs"
done

# Release all loop devices
for i in 0 1 2 3 4 5 6 7
do
  losetup 2>/dev/null -d /dev/loop$i && echo -n " /dev/loop$i" || :
done

echo '.'

: exit 0


--- End Message ---
--- Begin Message ---
This bug is being closed as part of a cleanup of the old bug
reports in the sysvinit package, in an attempt to make it easier
to address the bug reports which actually are fixable.  Some
reasons:

- Not a bug and/or it's a patch which will not be applied
- It will not be fixed, ever for various reasons
- Problem is not fixable in sysvinit or not our responsibility
- A better solution has become available in the interim
- No activity or submitter response in over a decade or more


Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.


--- End Message ---
_______________________________________________
Pkg-sysvinit-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-sysvinit-devel

Reply via email to