Debian Bug report logs - #494001
debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26

version graph

Package: initscripts; Maintainer for initscripts is Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>; Source for initscripts is src:sysvinit.

Reported by: Roger Leigh <rleigh@debian.org>

Date: Wed, 6 Aug 2008 14:39:03 UTC

Severity: important

Tags: fixed-upstream, patch

Merged with 642558

Found in version 2.88dsf-13.11

Fixed in version sysvinit/2.88dsf-14

Done: Roger Leigh <rleigh@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, debian-boot@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#494001; Package debian-installer. Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@debian.org>:
New Bug report received and forwarded. Copy sent to debian-boot@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Wed, 06 Aug 2008 15:32:50 +0100
Package: debian-installer
Severity: important

/etc/mtab can be either a regular file updated by mount/umount, or a symlink 
to /proc/mounts.  Currently, it is a regular file, though the user can change 
this by hand.

With linux < 2.6.26, /proc/mounts lacks information present in /etc/mtab such 
as additional mount options.  Thus a symlink breaks things like discquotas 
which rely on parsing the additional mount options.  As a result, we are 
mostly all still using it as a plain file.

With linux >= 2.6.26, /proc/mounts contains all of the information in 
/etc/mtab, plus more.  The mount system call can now pass all of the mount 
options to the kernel, so no information is missing in /proc/mounts.  This 
has obviously useful benefits such as read-only root, and the state in 
/etc/mtab never gets out of sync with reality (there are a number of open 
bugs against mount where this occurs).

Additionally, with the addition of per-process namespaces with CLONE_NEWNS to 
clone(2), each process has its own set of mounts, and as such a system-wide 
/etc/mtab is useless: it's only valid in one of the potentially many 
namespaces and can quickly get into a horrible mess.  At this point, 
/etc/mtab *must* be a symlink to avoid breakage.  Note that /proc/mounts is 
now a symlink to /proc/self/mounts for this reason: each process has
potentially different mounts.


After discussion on #debian-devel, we came up with these points:
- we could detect the kernel version on boot, and set up a file or a symlink 
  as needed.  However, this breaks read-only root.
- we could change on upgrades rather than boot, but because it's dependent 
  upon the kernel version, breakage could result if an older kernel is
  booted.
- doing it at install time if a kernel >= 2.6.26 is installed is the most 
  robust solution.


I had a look at a number of sources (debootstrap, base-files, 
debian-installer), but I have yet to find the code that initially creates 
/etc/mtab (if any).  Some of the init scripts will re-create it if not 
present (and these could do with updating too for Lenny+1), but ideally if 
d-i installs a kernel >= 2.6.26, it should just ensure that /etc/mtab is a 
symlink during the install.

If we could get this change made for Lenny, that would be great.


Thanks for your time,
Roger

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.20.3-bytemark-uml-2
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#494001; Package debian-installer. Full text and rfc822 format available.

Acknowledgement sent to "Radim X." <radim111@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. Full text and rfc822 format available.

Message #10 received at 494001@bugs.debian.org (full text, mbox):

From: "Radim X." <radim111@gmail.com>
To: 494001@bugs.debian.org
Subject: Re: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Thu, 7 Aug 2008 14:19:33 +0200
Are you sure that this won't break things elsewhere? Other packages
might use /etc/mtab with inotify to watch mount events (especially for
removable media). They would have to switch to a different method,
since /proc does not support inotify and udev doesn't help either.

Radim




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#494001; Package debian-installer. Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@whinlatter.ukfsn.org>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. Full text and rfc822 format available.

Message #15 received at 494001@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@whinlatter.ukfsn.org>
To: "Radim X." <radim111@gmail.com>, 494001@bugs.debian.org
Subject: Re: Bug#494001: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Sun, 10 Aug 2008 12:04:55 +0100
[Message part 1 (text/plain, inline)]
On Thu, Aug 07, 2008 at 02:19:33PM +0200, Radim X. wrote:

[please CC the submitter as well as the bug number, or else they don't
get a reply!]

> Are you sure that this won't break things elsewhere?

Yes; the whole point of this change is to stop breaking things that are
currently broken, including a whole plethora of bugs in mount(1).

> Other packages
> might use /etc/mtab with inotify to watch mount events (especially for
> removable media). They would have to switch to a different method,
> since /proc does not support inotify and udev doesn't help either.

Do you have any examples of packages which use /etc/mtab in this way?

I checked KDE 3.5.5 and it seems to be working fine.  Note that inotify
is very new, is Linux-specific, and all of the common desktop
environments are portable to many different platforms and hence will
detect changes using mechanisms other than inotify.  IMO this is not
a stopper for moving to a symlink.


Regards,
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.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#494001; Package debian-installer. Full text and rfc822 format available.

Acknowledgement sent to "Radim X." <radim111@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. Full text and rfc822 format available.

Message #20 received at 494001@bugs.debian.org (full text, mbox):

From: "Radim X." <radim111@gmail.com>
To: "Roger Leigh" <rleigh@whinlatter.ukfsn.org>
Cc: 494001@bugs.debian.org
Subject: Re: Bug#494001: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Wed, 13 Aug 2008 10:32:52 +0200
> [please CC the submitter as well as the bug number, or else they don't
> get a reply!]

Oops, sorry. For now, it's To: you plus cc to BTS. Should I cc debian-boot
as well?

> Do you have any examples of packages which use /etc/mtab in this way?

No. But...
> I checked KDE 3.5.5 and it seems to be working fine.  Note that inotify
> is very new, is Linux-specific, and all of the common desktop
> environments are portable to many different platforms and hence will
> detect changes using mechanisms other than inotify.  IMO this is not
> a stopper for moving to a symlink.

... inotify is probably going to stay with us. Being better than polling, many
packages might just consider switching to inotify (since it is a new thing). Not
the huge ones like KDE and Gnome and the like (they have dbus/hal). Smaller
packages which do not want to use dbus/hal would have little choice after
this change.

It's not only that inotify was imho introduced just to deal with this kind of
things, but the kernel developers are also considering to move away from
atime. Plus, support for mount/umount events was dropped from udev...

Aside from Gnome/KDE/..., I guess it isn't so much of a problem of inotify being
Linux-specific, many of the smaller packages often don't even think of being
portable to other kernels.

I perfectly understand your reasons, but please do consider waiting with this
change, speaking to the kernel people about inotify support in (parts of) /proc,
or... whatever. I admit, I don't have a really good solution ready.

Regards,

Radim




Bug reassigned from package `debian-installer' to `initscripts'. Request was from Roger Leigh <rleigh@debian.org> to control@bugs.debian.org. (Wed, 18 Mar 2009 20:06:02 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Wed, 18 Mar 2009 20:24:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Wed, 18 Mar 2009 20:24:04 GMT) Full text and rfc822 format available.

Message #27 received at 494001@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Roger Leigh <rleigh@debian.org>, 494001@bugs.debian.org
Cc: Petter Reinholdtsen <pere@debian.org>
Subject: Re: Bug#494001: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Wed, 18 Mar 2009 20:21:02 +0000
[Message part 1 (text/plain, inline)]
tags 494001 + patch
thanks

On Wed, Aug 06, 2008 at 03:32:50PM +0100, Roger Leigh wrote:
> /etc/mtab can be either a regular file updated by mount/umount, or a symlink 
> to /proc/mounts.  Currently, it is a regular file, though the user can change 
> this by hand.
> 
> With linux < 2.6.26, /proc/mounts lacks information present in /etc/mtab such 
> as additional mount options.  Thus a symlink breaks things like discquotas 
> which rely on parsing the additional mount options.  As a result, we are 
> mostly all still using it as a plain file.
> 
> With linux >= 2.6.26, /proc/mounts contains all of the information in 
> /etc/mtab, plus more.  The mount system call can now pass all of the mount 
> options to the kernel, so no information is missing in /proc/mounts.  This 
> has obviously useful benefits such as read-only root, and the state in 
> /etc/mtab never gets out of sync with reality (there are a number of open 
> bugs against mount where this occurs).
> 
> Additionally, with the addition of per-process namespaces with CLONE_NEWNS to 
> clone(2), each process has its own set of mounts, and as such a system-wide 
> /etc/mtab is useless: it's only valid in one of the potentially many 
> namespaces and can quickly get into a horrible mess.  At this point, 
> /etc/mtab *must* be a symlink to avoid breakage.  Note that /proc/mounts is 
> now a symlink to /proc/self/mounts for this reason: each process has
> potentially different mounts.
> 
> 
> After discussion on #debian-devel, we came up with these points:
> - we could detect the kernel version on boot, and set up a file or a symlink 
>   as needed.  However, this breaks read-only root.
> - we could change on upgrades rather than boot, but because it's dependent 
>   upon the kernel version, breakage could result if an older kernel is
>   booted.
> - doing it at install time if a kernel >= 2.6.26 is installed is the most 
>   robust solution.

Following further discussion today, we concluded that

- the initscripts postinst was the appropriate place to do this.
- since Lenny uses Linux 2.6.26, and Squeeze will require Linux >= 2.6.26
  a version check was not required.
- non-Linux kernels don't support /proc, so only make this change for
  Linux.
- comments in the bug report concerning inotify were not justified and
  should not hold back this change.


I have attached a small patch against sysvinit to implement this change
in initscripts.  It's not yet tested; it's just to show the intent of
the changes I'd like to make.


Thanks,
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.
[sysvinit-mtab-diff (text/plain, attachment)]

Tags added: patch Request was from Roger Leigh <rleigh@codelibre.net> to control@bugs.debian.org. (Wed, 18 Mar 2009 20:24:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Wed, 18 Mar 2009 20:42:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Henrique de Moraes Holschuh <hmh@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Wed, 18 Mar 2009 20:42:08 GMT) Full text and rfc822 format available.

Message #34 received at 494001@bugs.debian.org (full text, mbox):

From: Henrique de Moraes Holschuh <hmh@debian.org>
To: 494001@bugs.debian.org
Cc: Roger Leigh <rleigh@codelibre.net>, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>
Subject: Re: [Pkg-sysvinit-devel] Processed: Re: Bug#494001: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Wed, 18 Mar 2009 17:38:38 -0300
Are there other parts of Squeeze that would malfunction with Linux kernels
older than 2.6.26 ?

The version check is pretty much a good idea for safety reasons, I think it
would be better to just leave it in, and we can get rid of it for Squeeze+1.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Wed, 18 Mar 2009 22:48:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Wed, 18 Mar 2009 22:48:05 GMT) Full text and rfc822 format available.

Message #39 received at 494001@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Henrique de Moraes Holschuh <hmh@debian.org>
Cc: 494001@bugs.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>
Subject: Re: [Pkg-sysvinit-devel] Processed: Re: Bug#494001: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Wed, 18 Mar 2009 22:44:12 +0000
[Message part 1 (text/plain, inline)]
On Wed, Mar 18, 2009 at 05:38:38PM -0300, Henrique de Moraes Holschuh wrote:
> Are there other parts of Squeeze that would malfunction with Linux kernels
> older than 2.6.26 ?
> 
> The version check is pretty much a good idea for safety reasons, I think it
> would be better to just leave it in, and we can get rid of it for Squeeze+1.

Agreed.  I've attached a new patch with a version check.  I've now
tested the patch by installing the package, and it correctly updates
the symlink, and also preserves it if already a symlink.  The only
corner case we have here is if the admin already deliberately
symlinked it somewhere else--we won't link it to /proc/mounts in
this case (do we want to trample on the admins changes in this
case?).

I used dpkg --compare-versions, which I hope is OK for kernel revisions.

I haven't explicitly removed /etc/init.d/mtab.sh.  This does not appear
to get removed automatically on upgrade due to being a conffile and dpkg
not removing it automatically.  It probably wants removing in the
postinst as well.


Regards,
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.
[sysvinit-mtab-patch2 (text/plain, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Thu, 19 Mar 2009 02:18:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Henrique de Moraes Holschuh <hmh@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Thu, 19 Mar 2009 02:18:02 GMT) Full text and rfc822 format available.

Message #44 received at 494001@bugs.debian.org (full text, mbox):

From: Henrique de Moraes Holschuh <hmh@debian.org>
To: Roger Leigh <rleigh@codelibre.net>
Cc: 494001@bugs.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>
Subject: Re: [Pkg-sysvinit-devel] Processed: Re: Bug#494001: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Wed, 18 Mar 2009 23:14:54 -0300
On Wed, 18 Mar 2009, Roger Leigh wrote:
> On Wed, Mar 18, 2009 at 05:38:38PM -0300, Henrique de Moraes Holschuh wrote:
> > Are there other parts of Squeeze that would malfunction with Linux kernels
> > older than 2.6.26 ?
> > 
> > The version check is pretty much a good idea for safety reasons, I think it
> > would be better to just leave it in, and we can get rid of it for Squeeze+1.
> 
> Agreed.  I've attached a new patch with a version check.  I've now
> tested the patch by installing the package, and it correctly updates
> the symlink, and also preserves it if already a symlink.  The only
> corner case we have here is if the admin already deliberately
> symlinked it somewhere else--we won't link it to /proc/mounts in
> this case (do we want to trample on the admins changes in this
> case?).
> 
> I used dpkg --compare-versions, which I hope is OK for kernel revisions.

The more I think about it, the less I like this way of doing things.

You have to adjust to the running kernel, at every boot.  It is *normal* to
boot on kernel x.y.z, then go back to x.y-1.z, etc.

I.e. call uname, and find out what kernel you're dealing with at that boot,
and have /etc/mtab set up before mount (or anything else) needs it.  That
means early initscript, not postinst.

In the end, it really means we should teach mount to know what to do by
itself, and get rid of /etc/mtab, if we want to fix things properly.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Thu, 19 Mar 2009 10:12:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Thu, 19 Mar 2009 10:12:05 GMT) Full text and rfc822 format available.

Message #49 received at 494001@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Henrique de Moraes Holschuh <hmh@debian.org>
Cc: 494001@bugs.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>
Subject: Re: [Pkg-sysvinit-devel] Processed: Re: Bug#494001: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Thu, 19 Mar 2009 10:11:19 +0000
Henrique de Moraes Holschuh wrote:
> On Wed, 18 Mar 2009, Roger Leigh wrote:
>> On Wed, Mar 18, 2009 at 05:38:38PM -0300, Henrique de Moraes Holschuh wrote:
>>> Are there other parts of Squeeze that would malfunction with Linux kernels
>>> older than 2.6.26 ?
>>>
>>> The version check is pretty much a good idea for safety reasons, I think it
>>> would be better to just leave it in, and we can get rid of it for Squeeze+1.
>> Agreed.  I've attached a new patch with a version check.  I've now
>> tested the patch by installing the package, and it correctly updates
>> the symlink, and also preserves it if already a symlink.  The only
>> corner case we have here is if the admin already deliberately
>> symlinked it somewhere else--we won't link it to /proc/mounts in
>> this case (do we want to trample on the admins changes in this
>> case?).
>>
>> I used dpkg --compare-versions, which I hope is OK for kernel revisions.
> 
> The more I think about it, the less I like this way of doing things.
> 
> You have to adjust to the running kernel, at every boot.  It is *normal* to
> boot on kernel x.y.z, then go back to x.y-1.z, etc.

True, and I did consider this.  However, it was pointed out that since 
squeeze would not run with kernels < 2.6.26, and Lenny uses 2.6.26, so 
this checking was pointless, even on upgrades.  Since the postinst is 
run only once, the version check is probably redundant here as well.

> I.e. call uname, and find out what kernel you're dealing with at that boot,
> and have /etc/mtab set up before mount (or anything else) needs it.  That
> means early initscript, not postinst.

I did originally modify mtab.sh to check the kernel version and then 
either create a symlink or an empty file depending upon the kernel 
version.  However, the consensus was that this was pointless and that it 
should just be done "once and for all" in the postinst.

> In the end, it really means we should teach mount to know what to do by
> itself, and get rid of /etc/mtab, if we want to fix things properly.

What should mount do?  If mtab is a symlink, it then doesn't do any 
updating at all.  Removing mtab itself is a tricker (and IMO separate) 
issue, since many programs are using setmntent(3) to open it and this 
would require the updating of many programs (and the change would also 
be Linux-specific and non-portable).

By the way, if mtab is a symlink on Linux < 2.6.26, then the system will 
continue to work without problems.  I've used Linux systems configured 
this way for many years.  The only potential problems are if other 
programs want to check the extended mount options (such as for diskquota 
checking); for most uses this is not a problem.  The only uses who will 
be affected are those running an old and unsupported kernel version.


Regards,
Roger





Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Thu, 19 Mar 2009 15:12:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Thu, 19 Mar 2009 15:12:02 GMT) Full text and rfc822 format available.

Message #54 received at 494001@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Henrique de Moraes Holschuh <hmh@debian.org>
Cc: 494001@bugs.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>
Subject: Re: [Pkg-sysvinit-devel] Processed: Re: Bug#494001: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Thu, 19 Mar 2009 15:08:52 +0000
On Wed, Mar 18, 2009 at 11:14:54PM -0300, Henrique de Moraes Holschuh wrote:
> On Wed, 18 Mar 2009, Roger Leigh wrote:
> > On Wed, Mar 18, 2009 at 05:38:38PM -0300, Henrique de Moraes Holschuh wrote:
> > > Are there other parts of Squeeze that would malfunction with Linux kernels
> > > older than 2.6.26 ?
> > > 
> > > The version check is pretty much a good idea for safety reasons, I think it
> > > would be better to just leave it in, and we can get rid of it for Squeeze+1.
> > 
> > Agreed.  I've attached a new patch with a version check.  I've now
> > tested the patch by installing the package, and it correctly updates
> > the symlink, and also preserves it if already a symlink.  The only
> > corner case we have here is if the admin already deliberately
> > symlinked it somewhere else--we won't link it to /proc/mounts in
> > this case (do we want to trample on the admins changes in this
> > case?).
> > 
> > I used dpkg --compare-versions, which I hope is OK for kernel revisions.
> 
> The more I think about it, the less I like this way of doing things.
> 
> You have to adjust to the running kernel, at every boot.  It is *normal* to
> boot on kernel x.y.z, then go back to x.y-1.z, etc.

BTW, if you don't agree with the rationale in my previous mail, let
me know and I'll redo the patch to do the version check in mtab.sh.
The overall concensus on #debian-devel was to just kill it, though.


Regards,
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.




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Thu, 19 Mar 2009 15:12:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Henrique de Moraes Holschuh <hmh@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Thu, 19 Mar 2009 15:12:03 GMT) Full text and rfc822 format available.

Message #59 received at 494001@bugs.debian.org (full text, mbox):

From: Henrique de Moraes Holschuh <hmh@debian.org>
To: Roger Leigh <rleigh@codelibre.net>
Cc: 494001@bugs.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>
Subject: Re: [Pkg-sysvinit-devel] Processed: Re: Bug#494001: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Thu, 19 Mar 2009 12:09:33 -0300
On Thu, 19 Mar 2009, Roger Leigh wrote:
> True, and I did consider this.  However, it was pointed out that since
> squeeze would not run with kernels < 2.6.26, and Lenny uses 2.6.26, so

I'd still like to know WHAT in squeeze will break with kernels < 2.6.26.  I
have already asked that, but got no answer.

Depending on what is going to break and when, yes, we will be able to do
away with the version checks at runtime, which will make things much
simpler.  But I'd appreciate that crucial piece of information.  What is
going to break with kernel < 2.6.26?

I get the point that we should still provide /etc/mtab because there is
widespread usage, although fixing mount would be a damn good idea, because
it is the only piece of code that needs to deal with /etc/mtab functionality
at early userspace.

BTW, if /etc/mtab is to be read through a bunch of standard libc functions,
fixing glibc to ignore /etc/mtab and use /proc/mounts directly when running
on a new-enough Linux kernel would fix a lot of crap for good.  If mount
uses these functions, we wouldn't even need to touch mount, at most request
a binNMU if it is statically linked (I didn't check).

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Thu, 19 Mar 2009 15:12:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Henrique de Moraes Holschuh <hmh@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Thu, 19 Mar 2009 15:12:04 GMT) Full text and rfc822 format available.

Message #64 received at 494001@bugs.debian.org (full text, mbox):

From: Henrique de Moraes Holschuh <hmh@debian.org>
To: Roger Leigh <rleigh@codelibre.net>
Cc: 494001@bugs.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>
Subject: Re: [Pkg-sysvinit-devel] Processed: Re: Bug#494001: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Thu, 19 Mar 2009 12:10:58 -0300
On Thu, 19 Mar 2009, Roger Leigh wrote:
> BTW, if you don't agree with the rationale in my previous mail, let
> me know and I'll redo the patch to do the version check in mtab.sh.
> The overall concensus on #debian-devel was to just kill it, though.

I just need to know WHAT is supposedly to make squeeze incompatible with
the Linux kernel before 2.6.26, to make an informed decision :)

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Fri, 20 Mar 2009 00:27:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to md@Linux.IT (Marco d'Itri):
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Fri, 20 Mar 2009 00:27:03 GMT) Full text and rfc822 format available.

Message #69 received at 494001@bugs.debian.org (full text, mbox):

From: md@Linux.IT (Marco d'Itri)
Cc: debian-devel@lists.debian.org, 494001@bugs.debian.org
Subject: Re: Minimum kernel requirement for Squeeze
Date: Fri, 20 Mar 2009 01:25:08 +0100
[Message part 1 (text/plain, inline)]
On Mar 19, Roger Leigh <rleigh@codelibre.net> wrote:

> With respect to #494001, I would like to determine the minimum
> version of the linux kernel we will
For the new udev package[1] I am trying *very* hard to keep it working
even with 2.6.18 kernels long enough to be able to finish the upgrade,
but I can tell you that 2.6.22 is currently required to support
important features like persistent device names and this will only get
"worse" with time so next year I may end out requiring 2.6.26 anyway.

Also expect problems from a modern udev and lenny kernels, because they
have CONFIG_SYSFS_DEPRECATED defined.

I agree that there should be no version check in the init scripts, just
symlink mtab and almost everything will work fine.

BTW, the comment about using inotify on /etc/mtab is pure crack: the
orthodox way to be notified of file systems changes is to use inotify on
/proc/mounts.

[1] http://www.bofh.it/~md/debian/ please test it and report your
    experience! Probably it's not toxic.

-- 
ciao,
Marco
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Sat, 21 Mar 2009 05:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Henrique de Moraes Holschuh <hmh@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Sat, 21 Mar 2009 05:36:02 GMT) Full text and rfc822 format available.

Message #74 received at 494001@bugs.debian.org (full text, mbox):

From: Henrique de Moraes Holschuh <hmh@debian.org>
To: Marco d'Itri <md@Linux.IT>, 494001@bugs.debian.org
Cc: debian-devel@lists.debian.org
Subject: Re: [Pkg-sysvinit-devel] Bug#494001: Minimum kernel requirement for Squeeze
Date: Sat, 21 Mar 2009 02:33:38 -0300
On Fri, 20 Mar 2009, Marco d'Itri wrote:
> On Mar 19, Roger Leigh <rleigh@codelibre.net> wrote:
> > With respect to #494001, I would like to determine the minimum
> > version of the linux kernel we will
> For the new udev package[1] I am trying *very* hard to keep it working
> even with 2.6.18 kernels long enough to be able to finish the upgrade,
> but I can tell you that 2.6.22 is currently required to support
> important features like persistent device names and this will only get
> "worse" with time so next year I may end out requiring 2.6.26 anyway.
> 
> Also expect problems from a modern udev and lenny kernels, because they
> have CONFIG_SYSFS_DEPRECATED defined.
> 
> I agree that there should be no version check in the init scripts, just
> symlink mtab and almost everything will work fine.

So be it, then.  Let's switch to the new mode unconditionally... since udev
is going to force our hands, might as well at least get something good out
of it and simplify things on the initscripts end.

A NEWS entry will be required to warn people using older kernels, though.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Sat, 21 Mar 2009 13:06:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Sat, 21 Mar 2009 13:06:05 GMT) Full text and rfc822 format available.

Message #79 received at 494001@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Henrique de Moraes Holschuh <hmh@debian.org>
Cc: 494001@bugs.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>
Subject: Re: [Pkg-sysvinit-devel] Processed: Re: Bug#494001: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Sat, 21 Mar 2009 13:04:00 +0000
[Message part 1 (text/plain, inline)]
On Thu, Mar 19, 2009 at 12:10:58PM -0300, Henrique de Moraes Holschuh wrote:
> On Thu, 19 Mar 2009, Roger Leigh wrote:
> > BTW, if you don't agree with the rationale in my previous mail, let
> > me know and I'll redo the patch to do the version check in mtab.sh.
> > The overall concensus on #debian-devel was to just kill it, though.
> 
> I just need to know WHAT is supposedly to make squeeze incompatible with
> the Linux kernel before 2.6.26, to make an informed decision :)

I just saw your reply on -devel.  I'm guessing it's udev; not something
I'm totally happy about, but I guess systems using it are the exception
nowadays.

I've attached a new patch which removes the version check, but keeps
the kernel check intact.  It also removes the conffiles in postrm.

I did see in the postrm that you are removing the conffile and
conffile.dpkg-old.  You are, however, not removing conffile.dpkg-new
or conffile.dpkg-dist.  Is this indentional or just an omission?


Regards,
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.
[sysvinit-mtab-remove-3.patch (text/x-diff, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Mon, 11 May 2009 18:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kel Modderman <kel@otaku42.de>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Mon, 11 May 2009 18:39:02 GMT) Full text and rfc822 format available.

Message #84 received at 494001@bugs.debian.org (full text, mbox):

From: Kel Modderman <kel@otaku42.de>
To: pkg-sysvinit-devel@lists.alioth.debian.org
Cc: Roger Leigh <rleigh@codelibre.net>, Henrique de Moraes Holschuh <hmh@debian.org>, 494001@bugs.debian.org
Subject: Re: [Pkg-sysvinit-devel] Processed: Re: Bug#494001: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Tue, 12 May 2009 04:36:12 +1000
[Message part 1 (text/plain, inline)]
On Saturday 21 March 2009 23:04:00 Roger Leigh wrote:
> On Thu, Mar 19, 2009 at 12:10:58PM -0300, Henrique de Moraes Holschuh wrote:
> > On Thu, 19 Mar 2009, Roger Leigh wrote:
> > > BTW, if you don't agree with the rationale in my previous mail, let
> > > me know and I'll redo the patch to do the version check in mtab.sh.
> > > The overall concensus on #debian-devel was to just kill it, though.
> > 
> > I just need to know WHAT is supposedly to make squeeze incompatible with
> > the Linux kernel before 2.6.26, to make an informed decision :)
> 
> I just saw your reply on -devel.  I'm guessing it's udev; not something
> I'm totally happy about, but I guess systems using it are the exception
> nowadays.
> 
> I've attached a new patch which removes the version check, but keeps
> the kernel check intact.  It also removes the conffiles in postrm.

I updated your patch to remove /etc/init.d/mtab.sh from disk and clean up
a couple of things (no whitspace change in postrm, unrelated update-rc.d purge
of hostname.sh in postinst). Please take a look, I'd like to apply it to
the package vcs.

> 
> I did see in the postrm that you are removing the conffile and
> conffile.dpkg-old.  You are, however, not removing conffile.dpkg-new
> or conffile.dpkg-dist.  Is this indentional or just an omission?

I think it only cares about the orignial file or locally modified backups
created by the eliminate_conffile() function in initscripts.preinst.

Thanks, Kel.
[Message part 2 (text/html, inline)]
[purge_mtab_sh.patch (text/x-patch, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Mon, 11 May 2009 18:54:27 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kel Modderman <kel@otaku42.de>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Mon, 11 May 2009 18:54:27 GMT) Full text and rfc822 format available.

Message #89 received at 494001@bugs.debian.org (full text, mbox):

From: Kel Modderman <kel@otaku42.de>
To: pkg-sysvinit-devel@lists.alioth.debian.org, 494001@bugs.debian.org
Cc: Roger Leigh <rleigh@codelibre.net>
Subject: Re: [Pkg-sysvinit-devel] Bug#494001: Processed: Re: Bug#494001: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Tue, 12 May 2009 04:52:11 +1000
[Message part 1 (text/plain, inline)]
On Tuesday 12 May 2009 04:36:12 Kel Modderman wrote:
> On Saturday 21 March 2009 23:04:00 Roger Leigh wrote:
> > On Thu, Mar 19, 2009 at 12:10:58PM -0300, Henrique de Moraes Holschuh wrote:
> > > On Thu, 19 Mar 2009, Roger Leigh wrote:
> > > > BTW, if you don't agree with the rationale in my previous mail, let
> > > > me know and I'll redo the patch to do the version check in mtab.sh.
> > > > The overall concensus on #debian-devel was to just kill it, though.
> > > 
> > > I just need to know WHAT is supposedly to make squeeze incompatible with
> > > the Linux kernel before 2.6.26, to make an informed decision :)
> > 
> > I just saw your reply on -devel.  I'm guessing it's udev; not something
> > I'm totally happy about, but I guess systems using it are the exception
> > nowadays.
> > 
> > I've attached a new patch which removes the version check, but keeps
> > the kernel check intact.  It also removes the conffiles in postrm.
> 
> I updated your patch to remove /etc/init.d/mtab.sh from disk and clean up
> a couple of things (no whitspace change in postrm, unrelated update-rc.d purge
> of hostname.sh in postinst). Please take a look, I'd like to apply it to
> the package vcs.

Also debian/initscripts/etc/init.d/checkfs.sh should not reference mtab in its
LSB info.

Does checkroot.sh need to change at all with respect to what it does to
/etc/mtab?

Thanks, Kel.
[Message part 2 (text/html, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Mon, 11 May 2009 19:45:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kel Modderman <kel@otaku42.de>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Mon, 11 May 2009 19:45:04 GMT) Full text and rfc822 format available.

Message #94 received at 494001@bugs.debian.org (full text, mbox):

From: Kel Modderman <kel@otaku42.de>
To: pkg-sysvinit-devel@lists.alioth.debian.org, 494001@bugs.debian.org
Cc: Roger Leigh <rleigh@codelibre.net>
Subject: Re: [Pkg-sysvinit-devel] Bug#494001: Bug#494001: Processed: Re: Bug#494001: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Tue, 12 May 2009 05:43:28 +1000
[Message part 1 (text/plain, inline)]
> Does checkroot.sh need to change at all with respect to what it does to
> /etc/mtab?

For example, something like the following, which checks /etc/mtab is a symlink
on Linux and attempts to create one to /proc/mounts if the conditions are
correct. Just in case initscripts postinst maintainer scripts cannot create
the symlink, because possibly the package was upgraded/installed offline and
/proc was not mounted.

Also clear out devfs stuff, which is afaik no longer supported.

Kel.
---
--- a/debian/initscripts/etc/init.d/checkroot.sh                                                
+++ b/debian/initscripts/etc/init.d/checkroot.sh                                                
@@ -39,7 +39,6 @@ do_start () {                                                                 
        #       device node,                                                                    
        # 2) Swap that is on a md device or a file that may be on a md                          
        #       device,                                                                         
-       # 3) The mount parameters for a devfs filesystem.                                       
        #                                                                                       
                                                                                                
        exec 9<&0 </etc/fstab                                                                   
@@ -52,7 +51,6 @@ do_start () {                                                                 
        rootcheck=no                                                                            
        swap_on_lv=no                                                                           
        swap_on_file=no                                                                         
-       devfs=                                                                                  
                                                                                                
        while read DEV MTPT FSTYPE OPTS DUMP PASS JUNK                                          
        do                                                                                      
@@ -75,11 +73,6 @@ do_start () {                                                                
                        [ "$FSTYPE" = "swap" ] && swap_on_file=yes                              
                        ;;                                                                      
                  *)                                                                            
-                       # Devfs definition ?                                                    
-                       if [ "$FSTYPE" = "devfs" ] && [ "$MTPT" = "/dev" ] && mountpoint -q /dev
-                       then                                                                    
-                               devfs="-t $FSTYPE $DEV $MTPT"                                   
-                       fi                                                                      
                        ;;                                                                      
                esac                                                                            
                [ "$MTPT" != "/" ] && continue                                                  
@@ -339,42 +332,17 @@ but requested that the system be restart                                  
        fi                                                                                      
                                                                                                
        #                                                                                       
-       # We only create/modify /etc/mtab if the location where it is                           
-       # stored is writable. If /etc/mtab is a symlink into /proc/                             
-       # then it is not writable.                                                              
-       #                                                                                       
-       INIT_MTAB_FILE=no                                                                       
-       MTAB_PATH="$(readlink -f /etc/mtab || :)"                                               
-       case "$MTAB_PATH" in                                                                    
-         /proc/*)                                                                              
-               ;;                                                                              
-         /*)                                                                                   
-               if touch "$MTAB_PATH" >/dev/null 2>&1                                           
-               then                                                                            
-                       :> "$MTAB_PATH"                                                         
-                       rm -f ${MTAB_PATH}~
-                       INIT_MTAB_FILE=yes
-               fi
-               ;;
-         "")
-               [ -L /etc/mtab ] && MTAB_PATH="$(readlink /etc/mtab)"
-               if [ "$MTAB_PATH" ]
+       # If /etc/mtab is not a symlink, attempt to symlink it to /proc/mounts
+       # on Linux. See #494001
+       #
+       if [ Linux = "$KERNEL" ] && [ ! -L /etc/mtab ] && [ -f /proc/mounts ]
+       then
+               if touch /etc/mtab >/dev/null 2>&1
                then
-                       log_failure_msg "Cannot initialize ${MTAB_PATH}."
+                       rm -f /etc/mtab && ln -s /proc/mounts /etc/mtab
                else
-                       log_failure_msg "Cannot initialize /etc/mtab."
+                       log_warning_msg "cannot symlink /etc/mtab to /proc/mounts"
                fi
-               ;;
-         *)
-               log_failure_msg "Illegal mtab location '${MTAB_PATH}'."
-               ;;
-       esac
-
-       if [ "$INIT_MTAB_FILE" = yes ]
-       then
-               [ "$roottype" != none ] &&
-                       mount -f -o $rootopts -t $roottype $fstabroot /
-               [ "$devfs" ] && mount -f $devfs
        fi

        #
---
[Message part 2 (text/html, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Mon, 11 May 2009 21:42:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Mon, 11 May 2009 21:42:03 GMT) Full text and rfc822 format available.

Message #99 received at 494001@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Kel Modderman <kel@otaku42.de>
Cc: pkg-sysvinit-devel@lists.alioth.debian.org, Henrique de Moraes Holschuh <hmh@debian.org>, 494001@bugs.debian.org
Subject: Re: [Pkg-sysvinit-devel] Processed: Re: Bug#494001:?debian-installer: /etc/mtab must be a symlink to /proc/mounts with?linux >= 2.6.26
Date: Mon, 11 May 2009 23:41:05 +0100
On Tue, May 12, 2009 at 04:36:12AM +1000, Kel Modderman wrote:
> On Saturday 21 March 2009 23:04:00 Roger Leigh wrote:
> > On Thu, Mar 19, 2009 at 12:10:58PM -0300, Henrique de Moraes Holschuh wrote:
> > > On Thu, 19 Mar 2009, Roger Leigh wrote:
> > > > BTW, if you don't agree with the rationale in my previous mail, let
> > > > me know and I'll redo the patch to do the version check in mtab.sh.
> > > > The overall concensus on #debian-devel was to just kill it, though.
> > > 
> > > I just need to know WHAT is supposedly to make squeeze incompatible with
> > > the Linux kernel before 2.6.26, to make an informed decision :)
> > 
> > I just saw your reply on -devel.  I'm guessing it's udev; not something
> > I'm totally happy about, but I guess systems using it are the exception
> > nowadays.
> > 
> > I've attached a new patch which removes the version check, but keeps
> > the kernel check intact.  It also removes the conffiles in postrm.
> 
> I updated your patch to remove /etc/init.d/mtab.sh from disk and clean up
> a couple of things (no whitspace change in postrm, unrelated update-rc.d purge
> of hostname.sh in postinst). Please take a look, I'd like to apply it to
> the package vcs.

Looks good to me.


Regards,
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.




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Sat, 30 May 2009 00:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Sat, 30 May 2009 00:06:02 GMT) Full text and rfc822 format available.

Message #104 received at 494001@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Henrique de Moraes Holschuh <hmh@debian.org>, 494001@bugs.debian.org
Subject: Re: Bug#494001: [Pkg-sysvinit-devel] Bug#494001: Minimum kernel requirement for Squeeze
Date: Sat, 30 May 2009 01:02:31 +0100
[Message part 1 (text/plain, inline)]
On Sat, Mar 21, 2009 at 02:33:38AM -0300, Henrique de Moraes Holschuh wrote:
> On Fri, 20 Mar 2009, Marco d'Itri wrote:
> > On Mar 19, Roger Leigh <rleigh@codelibre.net> wrote:
> > > With respect to #494001, I would like to determine the minimum
> > > version of the linux kernel we will
> > For the new udev package[1] I am trying *very* hard to keep it working
> > even with 2.6.18 kernels long enough to be able to finish the upgrade,
> > but I can tell you that 2.6.22 is currently required to support
> > important features like persistent device names and this will only get
> > "worse" with time so next year I may end out requiring 2.6.26 anyway.
> > 
> > Also expect problems from a modern udev and lenny kernels, because they
> > have CONFIG_SYSFS_DEPRECATED defined.
> > 
> > I agree that there should be no version check in the init scripts, just
> > symlink mtab and almost everything will work fine.
> 
> So be it, then.  Let's switch to the new mode unconditionally... since udev
> is going to force our hands, might as well at least get something good out
> of it and simplify things on the initscripts end.
> 
> A NEWS entry will be required to warn people using older kernels, though.

Has any further progress been made on this?  Are there any changes to the
patch you are waiting on me for?


Regards,
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.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Sat, 30 May 2009 00:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kel Modderman <kel@otaku42.de>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Sat, 30 May 2009 00:42:02 GMT) Full text and rfc822 format available.

Message #109 received at 494001@bugs.debian.org (full text, mbox):

From: Kel Modderman <kel@otaku42.de>
To: pkg-sysvinit-devel@lists.alioth.debian.org, Roger Leigh <rleigh@codelibre.net>, 494001@bugs.debian.org
Cc: Henrique de Moraes Holschuh <hmh@debian.org>
Subject: Re: [Pkg-sysvinit-devel] Bug#494001: Bug#494001: Minimum kernel requirement for Squeeze
Date: Sat, 30 May 2009 10:38:39 +1000
[Message part 1 (text/plain, inline)]
Hi Roger,

On Saturday 30 May 2009 10:02:31 Roger Leigh wrote:
> On Sat, Mar 21, 2009 at 02:33:38AM -0300, Henrique de Moraes Holschuh wrote:
> > On Fri, 20 Mar 2009, Marco d'Itri wrote:
> > > On Mar 19, Roger Leigh <rleigh@codelibre.net> wrote:
> > > > With respect to #494001, I would like to determine the minimum
> > > > version of the linux kernel we will
> > > For the new udev package[1] I am trying *very* hard to keep it working
> > > even with 2.6.18 kernels long enough to be able to finish the upgrade,
> > > but I can tell you that 2.6.22 is currently required to support
> > > important features like persistent device names and this will only get
> > > "worse" with time so next year I may end out requiring 2.6.26 anyway.
> > > 
> > > Also expect problems from a modern udev and lenny kernels, because they
> > > have CONFIG_SYSFS_DEPRECATED defined.
> > > 
> > > I agree that there should be no version check in the init scripts, just
> > > symlink mtab and almost everything will work fine.
> > 
> > So be it, then.  Let's switch to the new mode unconditionally... since udev
> > is going to force our hands, might as well at least get something good out
> > of it and simplify things on the initscripts end.
> > 
> > A NEWS entry will be required to warn people using older kernels, though.
> 
> Has any further progress been made on this?  Are there any changes to the
> patch you are waiting on me for?

I think I applied the patch already to sysvinit package SVN [0]. Sorry have
been a bit busy since then. We need to start talking about getting some
new uploads happening, but there are quite a few changes I have made which
need review but noone with much time to review 'em.

Can you have a good look at [0] for errors please?

[0] http://lists.alioth.debian.org/pipermail/pkg-sysvinit-commits/2009-May/001220.html

Thanks, Kel.
[Message part 2 (text/html, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Sat, 30 May 2009 10:42:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Sat, 30 May 2009 10:42:03 GMT) Full text and rfc822 format available.

Message #114 received at 494001@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Kel Modderman <kel@otaku42.de>
Cc: pkg-sysvinit-devel@lists.alioth.debian.org, 494001@bugs.debian.org, Henrique de Moraes Holschuh <hmh@debian.org>
Subject: Re: [Pkg-sysvinit-devel] Bug#494001: Bug#494001: Minimum kernel requirement for Squeeze
Date: Sat, 30 May 2009 11:39:42 +0100
[Message part 1 (text/plain, inline)]
On Sat, May 30, 2009 at 10:38:39AM +1000, Kel Modderman wrote:
> On Saturday 30 May 2009 10:02:31 Roger Leigh wrote:
> > Has any further progress been made on this?  Are there any changes to the
> > patch you are waiting on me for?
> 
> I think I applied the patch already to sysvinit package SVN [0]. Sorry have
> been a bit busy since then. We need to start talking about getting some
> new uploads happening, but there are quite a few changes I have made which
> need review but noone with much time to review 'em.
> 
> Can you have a good look at [0] for errors please?
> 
> [0] http://lists.alioth.debian.org/pipermail/pkg-sysvinit-commits/2009-May/001220.html

It looks fine.  The only slight oddity is the slight difference in logic
between checkroot.sh and postinst.  In particular, the need for

  touch /etc/mtab

in checkroot.sh

This uses:
        if [ Linux = "$KERNEL" ] && [ ! -L /etc/mtab ] && [ -f /proc/mounts ]
        then
                if touch /etc/mtab >/dev/null 2>&1
                then
                        rm -f /etc/mtab && ln -s /proc/mounts /etc/mtab
                else
                        log_warning_msg "cannot symlink /etc/mtab to /proc/mounts"
                fi
        fi

whereas the initscripts postinst uses:

if [ "$(uname -s)" = "Linux" ]
then
        if [ -f /etc/mtab ] && [ ! -L /etc/mtab ] && [ -f /proc/mounts ]
        then
                rm -f /etc/mtab && ln -s /proc/mounts /etc/mtab
        fi
fi

I'm guessing here it's to cope with a read-only root on startup that the
postinst doesn't need to care about.


Regards,
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.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Sat, 30 May 2009 12:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to ledestin@gmail.com:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Sat, 30 May 2009 12:00:03 GMT) Full text and rfc822 format available.

Message #119 received at 494001@bugs.debian.org (full text, mbox):

From: Dmitry Maksyoma <ledestin@gmail.com>
To: 494001@bugs.debian.org
Subject: `mount -o loop' runs out of loop devices
Date: Sat, 30 May 2009 23:49:16 +1200
Just to let you know: when /etc/mtab is a symlink to /proc/mounts, loop devices
aren't freed by umount and the system may run out of loop devices (which makes
things worse than they were with old-style mtab). Apparently, it's not a bug, as
it's documented in mount(8):

If you are not so unwise as to make /etc/mtab a symbolic link to /proc/mounts
then any loop device allocated by  mount  will  be freed by umount.  You can
also free a loop device by hand, using `losetup -d', see losetup(8).

-- 
/Dmitry <ledestin@gmail.com>




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Sun, 31 May 2009 12:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Henrique de Moraes Holschuh <hmh@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Sun, 31 May 2009 12:42:02 GMT) Full text and rfc822 format available.

Message #124 received at 494001@bugs.debian.org (full text, mbox):

From: Henrique de Moraes Holschuh <hmh@debian.org>
To: ledestin@gmail.com, 494001@bugs.debian.org
Subject: Re: [Pkg-sysvinit-devel] Bug#494001: `mount -o loop' runs out of loop devices
Date: Sun, 31 May 2009 09:39:17 -0300
On Sat, 30 May 2009, Dmitry Maksyoma wrote:
> Just to let you know: when /etc/mtab is a symlink to /proc/mounts, loop
> devices aren't freed by umount and the system may run out of loop devices
> (which makes things worse than they were with old-style mtab). Apparently,
> it's not a bug, as it's documented in mount(8):

If mount is still doing that (which I doubt), it needs to be fixed.  The
information it needs to free loop devices is part of /proc/mounts
nowadays...

Time to file a bug on mount(8).

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Mon, 01 Jun 2009 02:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to ledestin@gmail.com:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Mon, 01 Jun 2009 02:33:02 GMT) Full text and rfc822 format available.

Message #129 received at 494001@bugs.debian.org (full text, mbox):

From: Dmitry Maksyoma <ledestin@gmail.com>
To: Henrique de Moraes Holschuh <hmh@debian.org>
Cc: 494001@bugs.debian.org
Subject: Re: [Pkg-sysvinit-devel] Bug#494001: `mount -o loop' runs out of loop devices
Date: Mon, 1 Jun 2009 14:29:06 +1200
On Sun, May 31, 2009 at 09:39:17AM -0300, Henrique de Moraes Holschuh wrote:
> > Just to let you know: when /etc/mtab is a symlink to /proc/mounts, loop
> > devices aren't freed by umount and the system may run out of loop devices
> > (which makes things worse than they were with old-style mtab). Apparently,
> > it's not a bug, as it's documented in mount(8):
> 
> If mount is still doing that (which I doubt), it needs to be fixed.  The
> information it needs to free loop devices is part of /proc/mounts
> nowadays...
> 
> Time to file a bug on mount(8).

Mount bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=531371

-- 
/Dmitry <ledestin@gmail.com>




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Wed, 03 Jun 2009 08:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kel Modderman <kel@otaku42.de>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Wed, 03 Jun 2009 08:00:02 GMT) Full text and rfc822 format available.

Message #134 received at 494001@bugs.debian.org (full text, mbox):

From: Kel Modderman <kel@otaku42.de>
To: Roger Leigh <rleigh@codelibre.net>
Cc: pkg-sysvinit-devel@lists.alioth.debian.org, 494001@bugs.debian.org, Henrique de Moraes Holschuh <hmh@debian.org>
Subject: Re: [Pkg-sysvinit-devel] Bug#494001: Bug#494001: Minimum kernel requirement for Squeeze
Date: Wed, 3 Jun 2009 17:57:34 +1000
[Message part 1 (text/plain, inline)]
On Saturday 30 May 2009 20:39:42 Roger Leigh wrote:
> > Can you have a good look at [0] for errors please?
> > 
> > [0] http://lists.alioth.debian.org/pipermail/pkg-sysvinit-commits/2009-May/001220.html
> 
> It looks fine.  The only slight oddity is the slight difference in logic
> between checkroot.sh and postinst.  In particular, the need for
> 
>   touch /etc/mtab
> 
> in checkroot.sh
> 
> This uses:
>         if [ Linux = "$KERNEL" ] && [ ! -L /etc/mtab ] && [ -f /proc/mounts ]
>         then
>                 if touch /etc/mtab >/dev/null 2>&1
>                 then
>                         rm -f /etc/mtab && ln -s /proc/mounts /etc/mtab
>                 else
>                         log_warning_msg "cannot symlink /etc/mtab to /proc/mounts"
>                 fi
>         fi
> 
> whereas the initscripts postinst uses:
> 
> if [ "$(uname -s)" = "Linux" ]
> then
>         if [ -f /etc/mtab ] && [ ! -L /etc/mtab ] && [ -f /proc/mounts ]
>         then
>                 rm -f /etc/mtab && ln -s /proc/mounts /etc/mtab
>         fi
> fi
> 
> I'm guessing here it's to cope with a read-only root on startup that the
> postinst doesn't need to care about.

Yeah. Is that odd? Does it need a comment?

Thanks, Kel.
[Message part 2 (text/html, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Wed, 03 Jun 2009 14:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kel Modderman <kel@otaku42.de>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Wed, 03 Jun 2009 14:51:02 GMT) Full text and rfc822 format available.

Message #139 received at 494001@bugs.debian.org (full text, mbox):

From: Kel Modderman <kel@otaku42.de>
To: pkg-sysvinit-devel@lists.alioth.debian.org, ledestin@gmail.com, 494001@bugs.debian.org
Cc: Roger Leigh <rleigh@debian.org>
Subject: Re: [Pkg-sysvinit-devel] Bug#494001: `mount -o loop' runs out of loop devices
Date: Thu, 4 Jun 2009 00:43:29 +1000
[Message part 1 (text/plain, inline)]
CC'ing Roger.

On Saturday 30 May 2009 21:49:16 Dmitry Maksyoma wrote:
> 
> Just to let you know: when /etc/mtab is a symlink to /proc/mounts, loop devices
> aren't freed by umount and the system may run out of loop devices (which makes
> things worse than they were with old-style mtab). Apparently, it's not a bug, as
> it's documented in mount(8):
> 
> If you are not so unwise as to make /etc/mtab a symbolic link to /proc/mounts
> then any loop device allocated by  mount  will  be freed by umount.  You can
> also free a loop device by hand, using `losetup -d', see losetup(8).
> 

Thanks for pointing it out Dmitry.

Symlinking of mtab to /proc/mounts also seems to change/stop the user= mount
option from working properly.

Do the benefits of symlinking mtab -> mounts outweigh possible regressions
related to loop device mounting or user= mount option?

Thanks, Kel.
[Message part 2 (text/html, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Thu, 04 Jun 2009 18:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Thu, 04 Jun 2009 18:06:02 GMT) Full text and rfc822 format available.

Message #144 received at 494001@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Kel Modderman <kel@otaku42.de>
Cc: pkg-sysvinit-devel@lists.alioth.debian.org, 494001@bugs.debian.org, Henrique de Moraes Holschuh <hmh@debian.org>
Subject: Re: [Pkg-sysvinit-devel] Bug#494001: Bug#494001: Minimum kernel requirement for Squeeze
Date: Thu, 4 Jun 2009 19:05:15 +0100
On Wed, Jun 03, 2009 at 05:57:34PM +1000, Kel Modderman wrote:
> On Saturday 30 May 2009 20:39:42 Roger Leigh wrote:
> > > Can you have a good look at [0] for errors please?
> > > 
> > > [0] http://lists.alioth.debian.org/pipermail/pkg-sysvinit-commits/2009-May/001220.html
> > 
> > It looks fine.  The only slight oddity is the slight difference in logic
> > between checkroot.sh and postinst.  In particular, the need for
> > 
> >   touch /etc/mtab
> > 
> > in checkroot.sh
> > 
> > This uses:
> >         if [ Linux = "$KERNEL" ] && [ ! -L /etc/mtab ] && [ -f /proc/mounts ]
> >         then
> >                 if touch /etc/mtab >/dev/null 2>&1
> >                 then
> >                         rm -f /etc/mtab && ln -s /proc/mounts /etc/mtab
> >                 else
> >                         log_warning_msg "cannot symlink /etc/mtab to /proc/mounts"
> >                 fi
> >         fi
> > 
> > whereas the initscripts postinst uses:
> > 
> > if [ "$(uname -s)" = "Linux" ]
> > then
> >         if [ -f /etc/mtab ] && [ ! -L /etc/mtab ] && [ -f /proc/mounts ]
> >         then
> >                 rm -f /etc/mtab && ln -s /proc/mounts /etc/mtab
> >         fi
> > fi
> > 
> > I'm guessing here it's to cope with a read-only root on startup that the
> > postinst doesn't need to care about.
> 
> Yeah. Is that odd? Does it need a comment?

I think a comment by the touch to say why it's there (for the
read-only root on startup) will save (at least me) future
hours of headscratching working out why it was put there.
And it will make it harder for anyone to inadvertently removing
a "pointless" line in the script in the future.


Regards,
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.




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Thu, 04 Jun 2009 18:21:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Thu, 04 Jun 2009 18:21:07 GMT) Full text and rfc822 format available.

Message #149 received at 494001@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Kel Modderman <kel@otaku42.de>
Cc: pkg-sysvinit-devel@lists.alioth.debian.org, ledestin@gmail.com, 494001@bugs.debian.org, Roger Leigh <rleigh@debian.org>
Subject: Re: [Pkg-sysvinit-devel] Bug#494001: `mount -o loop' runs out of loop devices
Date: Thu, 4 Jun 2009 19:18:29 +0100
On Thu, Jun 04, 2009 at 12:43:29AM +1000, Kel Modderman wrote:
> CC'ing Roger.
> 
> On Saturday 30 May 2009 21:49:16 Dmitry Maksyoma wrote:
> > 
> > Just to let you know: when /etc/mtab is a symlink to /proc/mounts, loop devices
> > aren't freed by umount and the system may run out of loop devices (which makes
> > things worse than they were with old-style mtab). Apparently, it's not a bug, as
> > it's documented in mount(8):
> > 
> > If you are not so unwise as to make /etc/mtab a symbolic link to /proc/mounts
> > then any loop device allocated by  mount  will  be freed by umount.  You can
> > also free a loop device by hand, using `losetup -d', see losetup(8).
> > 
> 
> Thanks for pointing it out Dmitry.
> 
> Symlinking of mtab to /proc/mounts also seems to change/stop the user= mount
> option from working properly.

I think this may be a red herring.  The mount(8) manual page says a lot
of incorrect things about missing information in /proc/mounts which
is present in /etc/mtab.  However, with a current kernel all of the
information is there.

If umount was failing due to insufficient information, this is a non-
issue since all kernels from stable up support it.

If umount behaves differently if /etc/mtab is a symlink, then that's
a nasty bug in mount that needs fixing.  It's probably a trivial fix
to remove the special case handling of the symlink, if such a special
case is present.

> Do the benefits of symlinking mtab -> mounts outweigh possible regressions
> related to loop device mounting or user= mount option?

Yes.  For all the reasons given in the report.  Additionally,
it fixes a *lot* of bugs in mount, where mount would royally screw up
/etc/mtab when it got confused, or would misbehave due to having
incomplete information in /etc/mtab.  Things like "rbind" which are
used far more commonly than "loop" are basically broken with /etc/mtab
as a file.  With /etc/mtab as a symlink, it always represents the
current state of the system; it can't get out of date or corrupted.

However, if Dmitry can confirm this is a real bug (as opposed to a
documentation issue, in which case it still needs a bug against
mount), then the solution is fixing mount rather than not fixing this
bug.


Regards,
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.




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Fri, 05 Jun 2009 00:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to ledestin@gmail.com:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Fri, 05 Jun 2009 00:06:02 GMT) Full text and rfc822 format available.

Message #154 received at 494001@bugs.debian.org (full text, mbox):

From: Dmitry Maksyoma <ledestin@gmail.com>
To: Roger Leigh <rleigh@codelibre.net>
Cc: Kel Modderman <kel@otaku42.de>, pkg-sysvinit-devel@lists.alioth.debian.org, 494001@bugs.debian.org, Roger Leigh <rleigh@debian.org>
Subject: Re: [Pkg-sysvinit-devel] Bug#494001: `mount -o loop' runs out of loop devices
Date: Fri, 5 Jun 2009 12:02:11 +1200
On Thu, Jun 04, 2009 at 07:18:29PM +0100, Roger Leigh wrote:
> However, if Dmitry can confirm this is a real bug (as opposed to a
> documentation issue, in which case it still needs a bug against
> mount), then the solution is fixing mount rather than not fixing this
> bug.

Running out of loop devices is a real bug, documented in
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=531371.

-- 
/Dmitry <ledestin@gmail.com>




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Fri, 05 Jun 2009 16:30:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Fri, 05 Jun 2009 16:30:04 GMT) Full text and rfc822 format available.

Message #159 received at 494001@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Dmitry Maksyoma <ledestin@gmail.com>
Cc: Kel Modderman <kel@otaku42.de>, pkg-sysvinit-devel@lists.alioth.debian.org, 494001@bugs.debian.org, Roger Leigh <rleigh@debian.org>, 531371@bugs.debian.org
Subject: Re: [Pkg-sysvinit-devel] Bug#494001: `mount -o loop' runs out of loop devices
Date: Fri, 5 Jun 2009 17:15:15 +0100
On Fri, Jun 05, 2009 at 12:02:11PM +1200, Dmitry Maksyoma wrote:
> On Thu, Jun 04, 2009 at 07:18:29PM +0100, Roger Leigh wrote:
> > However, if Dmitry can confirm this is a real bug (as opposed to a
> > documentation issue, in which case it still needs a bug against
> > mount), then the solution is fixing mount rather than not fixing this
> > bug.
> 
> Running out of loop devices is a real bug, documented in
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=531371.

Confirmed.  The cause:

/etc/mtab:
/tmp/image2 /mnt ext2 rw,loop=/dev/loop0 0 0

/proc/mounts:
/dev/loop0 /mnt ext2 rw,errors=continue 0 0

So, it's lying about what's really mounted in /etc/mtab, and
umount uses this fact to losetup -d the loop device.

Solution: Fix mount to add an option such as auto-detach to
the mount options when using -o loop which tells us
unambiguously in all situations that we want to automatically
detach the loop.

This is a bug in mount, so really needs fixing there.  I checked
the source briefly and there's some bizarre stuff in there such
as loop=spec which I can't see actually used.  Should probably
be removed.


Regards,
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.




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Sun, 21 Jun 2009 12:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Sun, 21 Jun 2009 12:51:02 GMT) Full text and rfc822 format available.

Message #164 received at 494001@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Dmitry Maksyoma <ledestin@gmail.com>
Cc: 531371@bugs.debian.org, 494001@bugs.debian.org, Kel Modderman <kel@otaku42.de>, pkg-sysvinit-devel@lists.alioth.debian.org
Subject: Re: `mount -o loop' runs out of loop devices
Date: Sun, 21 Jun 2009 13:49:14 +0100
[Message part 1 (text/plain, inline)]
On Mon, Jun 01, 2009 at 02:19:51PM +1200, Dmitry Maksyoma wrote:
> 
> `mount -o loop' runs out of loop devices when /etc/mtab is a symlink to
> /proc/mounts.

Just rechecking this issue, and it no longer occurs for me:

% uname -a
Linux ravenclaw 2.6.30-1-amd64 #1 SMP Sun Jun 14 15:00:29 UTC 2009 x86_64 GNU/Linux
% ls -l /etc/mtab
lrwxrwxrwx 1 root root 12 2009-06-21 13:29 /etc/mtab -> /proc/mounts
% dd if=/dev/zero of=/tmp/l1 bs=1024 count=4096
% /sbin/mkfs -t ext2 /tmp/l1
% sudo mount -o loop /tmp/l1 /mnt
% sudo losetup -a
/dev/loop0: [0011]:175224 (/tmp/l1)
% grep /mnt /etc/mtab /proc/mounts
/etc/mtab:/dev/loop0 /mnt ext2 rw,relatime,errors=continue 0 0
/proc/mounts:/dev/loop0 /mnt ext2 rw,relatime,errors=continue 0 0
% sudo umount /mnt
% sudo losetup -a
% grep /mnt /etc/mtab /proc/mounts
%

I get the same loopback release with /etc/mtab as a regular file.

This may be due to the new kernel or new util-linux in unstable,
but it is now freeing the loop devices correctly.  It must be in
the new util-linux, because it's putting the loop device, rather
than the loopback filename, as the source in /etc/mtab such that
it always matches /proc/mounts.  Previously they differed, and
this resulted in the loop device not being freed when the loop
device was used.  This is no longer the case.  (I'm not familiar
with the util-linux source, but I can't actually see this change
and it /looks/ like it uses the old behaviour, but this may be
just a special case for certain use cases.  The observed
behaviour is what we want though!)

Dmitry, can you confirm this on your system?  Your bug report
shows you are using stable; do you have a system running
unstable you can check on (or if anyone else can check this as
I have above?)

Since this was IIRC the only blocker for #494001 (replacing
/etc/mtab with a symlink), it looks like this can now go
ahead if anyone else can confirm the loop issue is fixed.


Regards,
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.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Tue, 23 Jun 2009 10:21:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Tue, 23 Jun 2009 10:21:05 GMT) Full text and rfc822 format available.

Message #169 received at 494001@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: 494001@bugs.debian.org
Subject: Re: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Tue, 23 Jun 2009 12:00:24 +0200
Did anyone verify that smb and cifs mounts will get the same
information in /etc/mtab and /proc/mounts?  I was just told by Steve
Langasek that it is not the case for cifs.

Happy hacking,
-- 
Petter Reinholdtsen




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Tue, 23 Jun 2009 14:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to ledestin@gmail.com:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Tue, 23 Jun 2009 14:45:03 GMT) Full text and rfc822 format available.

Message #174 received at 494001@bugs.debian.org (full text, mbox):

From: Dmitry Maksyoma <ledestin@gmail.com>
To: Roger Leigh <rleigh@codelibre.net>
Cc: 531371@bugs.debian.org, 494001@bugs.debian.org, Kel Modderman <kel@otaku42.de>, pkg-sysvinit-devel@lists.alioth.debian.org
Subject: Re: `mount -o loop' runs out of loop devices
Date: Wed, 24 Jun 2009 02:42:04 +1200
On Sun, Jun 21, 2009 at 01:49:14PM +0100, Roger Leigh wrote:
> I get the same loopback release with /etc/mtab as a regular file.
> 
> This may be due to the new kernel or new util-linux in unstable,
> but it is now freeing the loop devices correctly.  It must be in
> the new util-linux, because it's putting the loop device, rather
> than the loopback filename, as the source in /etc/mtab such that
> it always matches /proc/mounts.  Previously they differed, and
> this resulted in the loop device not being freed when the loop
> device was used.  This is no longer the case.  (I'm not familiar
> with the util-linux source, but I can't actually see this change
> and it /looks/ like it uses the old behaviour, but this may be
> just a special case for certain use cases.  The observed
> behaviour is what we want though!)
> 
> Dmitry, can you confirm this on your system?  Your bug report
> shows you are using stable; do you have a system running
> unstable you can check on (or if anyone else can check this as
> I have above?)

Roger,

I've checked in squeeze using 2.6.26 kernel with /etc/mtab linked to
/proc/mounts and the loop device is freed according to losetup -a.

-- 
/Dmitry <ledestin@gmail.com>




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Sat, 19 Feb 2011 13:45:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Karel Zak <kzak@redhat.com>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Sat, 19 Feb 2011 13:45:06 GMT) Full text and rfc822 format available.

Message #179 received at 494001@bugs.debian.org (full text, mbox):

From: Karel Zak <kzak@redhat.com>
To: Roger Leigh <rleigh@debian.org>
Cc: util-linux-ng@vger.kernel.org
Subject: Re: Bug: mount: "user" mounts broken when /etc/mtab is a symlink
Date: Mon, 10 Jan 2011 15:08:46 +0100
On Sun, Jan 09, 2011 at 12:37:49PM +0000, Roger Leigh wrote:
> I just wanted to check with you which versions of util-linux-ng would
> work correctly with /etc/mtab removed
[...]
> If 2.19 is required

Yes. Note that "mtab removed" means mtab is symlink to /proc/mounts :-)

> I'd be interested to know how experimental libmount support is.

The code is not well tested.

> i.e. are there any known regressions or failing use cases which we
> should be aware of, or any other reasons not to enable it at this
> point?

Probably the most problematic thing is read-only bind. The problem is
described in the mount man page and this problem is not specific to
2.19, but to all systems without mtab.

with mtab:

    mount --bind olddir newdir
    mount -o remount,ro newdir

without mtab:

    mount --bind olddir newdir
    mount -o remount,ro,bind olddir newdir
                        ^^^^

The another problem is 

    mount -o loop /path/foo.img /mnt
    mount | grep /path/foo.img

where the grep command returns nothing on systems without mtab and
with old kernels (< 2.6.37). The latest kernel provides info about
loopdevs in /sys, so mtab is unnecessary.

> Have you removed mtab in Fedora/RedHat yet?

Yes, this is my plan for Fedora rawhide, because mtab is unsupported
by systemd.  On systems without systemd I'd suggest to be conservative
and compile mount without --enable-libmount-mount.

Note that more utils depend on mtab. It's not enough to updated
mount(8) -- the long term goal is to modify also mount.<type> helpers
to use libmount library (this is my goal for this year).  Then we can
say that mtab is really dead.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Sat, 19 Feb 2011 13:45:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chuck Lever <chuck.lever@oracle.com>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Sat, 19 Feb 2011 13:45:08 GMT) Full text and rfc822 format available.

Message #184 received at 494001@bugs.debian.org (full text, mbox):

From: Chuck Lever <chuck.lever@oracle.com>
To: Roger Leigh <rleigh@debian.org>
Cc: Karel Zak <kzak@redhat.com>, util-linux-ng@vger.kernel.org
Subject: Re: Bug: mount: "user" mounts broken when /etc/mtab is a symlink
Date: Mon, 10 Jan 2011 10:38:52 -0500
On Jan 9, 2011, at 7:37 AM, Roger Leigh wrote:

> On Tue, Jun 23, 2009 at 09:31:12PM +0200, Karel Zak wrote:
>> On Tue, Jun 23, 2009 at 11:32:44AM +0100, Roger Leigh wrote:
>>> On Mon, Jun 22, 2009 at 09:17:18PM +0200, Karel Zak wrote:
>>>> 
>>>> My plan is to support systems without /etc/mtab and use
>>>> /proc/self/mountinfo in util-linux-ng 2.{17,18} (September/October
>>>> 2009 or so...).
>>> 
>>> Cool.  Just to clarify: at this point, barring any unforseen bugs,
>>> we can delete /etc/mtab and running with just /proc will be a
>>> valid supported configuration?
>> 
>> Yes, mtab is Bad Thing.
>> 
>>> What will the minimum supported kernel version for such a configuration
>>> be (with mountinfo)?
>> 
>> kernel 2.6.26
> 
> Hi Karel,
> 
> I know this mail was from quite some time ago, but I've not been able
> to push this change in Debian for a while due to our freeze.  As soon
> as we're released, hopefully in a month or so, removing mtab will be
> on my TODO list again.
> 
> I just wanted to check with you which versions of util-linux-ng would
> work correctly with /etc/mtab removed, since they hadn't been released
> when we last wrote.  I didn't see anything in the 2.17/2.18 release
> notes, but did in 2.19, albeit with the libmount support, marked
> experimental.
> 
> If 2.19 is required, I'd be interested to know how experimental libmount
> support is.  i.e. are there any known regressions or failing use cases
> which we should be aware of, or any other reasons not to enable it at
> this point?

Are you aware of the NFS umount command's dependencies on the information in /etc/mtab?

When performing a umount, the mount.nfs command uses /etc/mtab to save the options that were used to mount that mount point (ie, options that enable the client to contact the server, and which NFS version the mount point uses).  Making /etc/mtab a link to /proc/mounts makes that whole process less reliable, so expect to see reports of umount failures with NFSv2 and NFSv3 in some corner cases.

We are hoping to use libmount, eventually, to store the command-line mount options somewhere besides /etc/mtab so that umount.nfs can continue to work reliably without /etc/mtab.

> Upgrades should be smooth given that we have 2.6.26 in stable as well.
> Have you removed mtab in Fedora/RedHat yet?
> 
> 
> Many thanks,
> Roger
> 
> 
> (I'm not subscribed to the util-linux-ng list, so a CC on any reply
> would be appreciated, thanks!)
> 
> -- 
>  .''`.  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.

-- 
Chuck Lever
chuck[dot]lever[at]oracle[dot]com








Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Sun, 10 Jul 2011 20:12:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Sun, 10 Jul 2011 20:12:06 GMT) Full text and rfc822 format available.

Message #189 received at 494001@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: 494001@bugs.debian.org
Cc: mbiebl@debian.org
Subject: Add blockers
Date: Sun, 10 Jul 2011 21:09:03 +0100
[Message part 1 (text/plain, inline)]
block 494001 by 620818
block 494001 by 622693
thanks

We're almost there.  We now have a libmount-enabled util-linux,
and a libmount-enabled nfs-utils.  We're waiting on cifs-utils
and libpam-mount (patches available).

Are there any other blockers at this point?


Regards,
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.
[signature.asc (application/pgp-signature, inline)]

Added blocking bug(s) of 494001: 620818 Request was from Roger Leigh <rleigh@codelibre.net> to control@bugs.debian.org. (Sun, 10 Jul 2011 20:12:08 GMT) Full text and rfc822 format available.

Added blocking bug(s) of 494001: 622693 Request was from Roger Leigh <rleigh@codelibre.net> to control@bugs.debian.org. (Sun, 10 Jul 2011 20:12:09 GMT) Full text and rfc822 format available.

Forcibly Merged 494001 642558. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Sat, 24 Sep 2011 01:54:03 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Sun, 23 Oct 2011 14:30:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Sun, 23 Oct 2011 14:30:04 GMT) Full text and rfc822 format available.

Message #200 received at 494001@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Kel Modderman <kel@otaku42.de>
Cc: pkg-sysvinit-devel@lists.alioth.debian.org, 494001@bugs.debian.org
Subject: Re: [Pkg-sysvinit-devel] Bug#494001: Bug#494001: Processed: Re: Bug#494001: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Sun, 23 Oct 2011 15:26:35 +0100
[Message part 1 (text/plain, inline)]
tags 494001 + patch
thanks

On Tue, May 12, 2009 at 05:43:28AM +1000, Kel Modderman wrote:
> > Does checkroot.sh need to change at all with respect to what it does to
> > /etc/mtab?
[patch]

I've attached a new patch against the current sources to implement
this.  Note that it only handles migration in one direction, that
it, it will not switch /back/ from a symlink in the absence of
/proc/mounts.  While this could be added, is this a situation we
really need to cater for?

There are no OS checks--this permits kfreebsd support and future
Hurd support.  The logic is in the shell function mtab_migrate
to permit the clean addition of special casing for e.g. Hurd.

This patch, like /dev/shm → /run/shm and /etc/network/ifstate →
/run/network/ifstate, does not preserve symlinks to places other
than /proc/* (the assumption being that symlinks to other files
were hacks to permit read-only root but still being static files).
Such hacks are no longer needed.


Regards,
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.
[0001-Migrate-etc-mtab-to-symlink-to-proc-mounts-when-poss.patch (text/x-diff, attachment)]
[0002-Close-494001.patch (text/x-diff, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Tue, 08 Nov 2011 22:18:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Tue, 08 Nov 2011 22:18:03 GMT) Full text and rfc822 format available.

Message #205 received at 494001@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Kel Modderman <kel@otaku42.de>
Cc: pkg-sysvinit-devel@lists.alioth.debian.org, 494001@bugs.debian.org
Subject: Re: [Pkg-sysvinit-devel] Bug#494001: Bug#494001: Processed: Re: Bug#494001: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Tue, 8 Nov 2011 22:15:29 +0000
On Sun, Oct 23, 2011 at 03:26:35PM +0100, Roger Leigh wrote:
> tags 494001 + patch
> thanks
> 
> On Tue, May 12, 2009 at 05:43:28AM +1000, Kel Modderman wrote:
> > > Does checkroot.sh need to change at all with respect to what it does to
> > > /etc/mtab?
> [patch]
> 
> I've attached a new patch against the current sources to implement
> this.  Note that it only handles migration in one direction, that
> it, it will not switch /back/ from a symlink in the absence of
> /proc/mounts.  While this could be added, is this a situation we
> really need to cater for?

I've not seen any response to this patch yet.  Would there be any
objections to uploading a new version containing this patch?

BTW, would it be possible to become a co-maintainer and join the
alioth group (if there are no objections)?


Thanks,
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.




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Tue, 08 Nov 2011 22:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Tue, 08 Nov 2011 22:45:04 GMT) Full text and rfc822 format available.

Message #210 received at 494001@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: 494001@bugs.debian.org
Cc: pkg-sysvinit-devel@lists.alioth.debian.org
Subject: Re: Bug#494001: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Tue, 08 Nov 2011 23:44:05 +0100
[Roger Leigh]
> I've attached a new patch against the current sources to implement
> this.  Note that it only handles migration in one direction, that
> it, it will not switch /back/ from a symlink in the absence of
> /proc/mounts.  While this could be added, is this a situation we
> really need to cater for?

Last time I checked, /proc/mounts did not contain all the status
information stored by mount in /etc/mtab, and thus were not really safe
to use in all cases as a replacement for /etc/mtab.  I do not remember
the details, but it might have been related to SMB mounts.

Did this change?  If not, replacing /etc/mtab with a symlink is not
really safe to do.

I believe that before this change is introduced, someone should check if
everything previously stored in /etc/mtab will be included in
/proc/mounts, at least for nfs, smb/cifs, fuse (like sshfs and others),
to make sure we do not introduce a regression.

I am aware that the new "container" stuff in Linux make /proc/mounts
content not match the stuff in /etc/mtab if processes have limited
access/view, but am not sure if that is a bigger problem than loosing
information in /etc/mtab that might be needed by umount.
-- 
Happy hacking
Petter Reinholdtsen




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Wed, 09 Nov 2011 00:24:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Wed, 09 Nov 2011 00:24:03 GMT) Full text and rfc822 format available.

Message #215 received at 494001@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Petter Reinholdtsen <pere@hungry.com>, 494001@bugs.debian.org
Cc: pkg-sysvinit-devel@lists.alioth.debian.org
Subject: Re: Bug#494001: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Wed, 9 Nov 2011 00:20:32 +0000
Hi Petter,

On Tue, Nov 08, 2011 at 11:44:05PM +0100, Petter Reinholdtsen wrote:
> 
> [Roger Leigh]
> > I've attached a new patch against the current sources to implement
> > this.  Note that it only handles migration in one direction, that
> > it, it will not switch /back/ from a symlink in the absence of
> > /proc/mounts.  While this could be added, is this a situation we
> > really need to cater for?
> 
> Last time I checked, /proc/mounts did not contain all the status
> information stored by mount in /etc/mtab, and thus were not really safe
> to use in all cases as a replacement for /etc/mtab.  I do not remember
> the details, but it might have been related to SMB mounts.
>
> Did this change?  If not, replacing /etc/mtab with a symlink is not
> really safe to do.

It is now.  There are two primary reasons:

1) The kernel can now store additional mount options and present them
   in /proc/mounts.  This was done in 2.6.2x IIRC.
2) util-linux libmount is used by the mount helpers such as mount.nfs
   to store additional stuff in /run/utab.  This handles the case
   where (1) is insufficient, and isn't normally needed.

The groundwork is all in place.  The major users (NFS, CIFS/SMB) are
already converted.  The remaining known tool (libpam-mount, #622693)
is fixed upstream and just waiting on a new util-linux (pending today).
Fedora made the change in Feb/March and have been mtabless for two
releases now.  It's time for us to do the same, I think, and get it
tested well before freezing.

I've been running with it as a symlink since the /run introduction,
which necessitated testing it.  I've not found any problems so far,
though obviously I can't have tested every filesystem mount option.

> I believe that before this change is introduced, someone should check if
> everything previously stored in /etc/mtab will be included in
> /proc/mounts, at least for nfs, smb/cifs, fuse (like sshfs and others),
> to make sure we do not introduce a regression.

This is done, TTBOMK.  I've pushed to get all the major mount helpers
to use libmount (where required).  NFS needed it; CIFS did not.  This
is just the last step of work starting in March. It's likely there are
going to be minor tools which may need conversion to use libmount, but
most work automatically with (1) above, and so don't require code
changes.  Basically, the rule of thumb is that direct editing of
/etc/mtab is no longer allowed--libmount handles this for you, and
stores the options in the appropriate place.

> I am aware that the new "container" stuff in Linux make /proc/mounts
> content not match the stuff in /etc/mtab if processes have limited
> access/view, but am not sure if that is a bigger problem than loosing
> information in /etc/mtab that might be needed by umount.

I think we're at or past the point where the cost of keeping mtab
outweigh the benefits.  It's not just containers; looking at the bug
list for util-linux, the number of mtab-related bugs is /huge/.  mount
--rbind is fundamentally broken, and several other mount options result
in broken mtabs which are inconsistent with /proc/mounts (missing or
incorrect entries, not even considering the mount options issue above).
These are much more commonly used than per-process namespaces, and are
utterly broken, and fixed by making it a symlink.  The result is that
the mtab contents are always consistent, and you can't get yourself
into the situation where you can't unmount things and get problems
due to the inconsistencies.


Regards,
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.




Information forwarded to debian-bugs-dist@lists.debian.org, Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>:
Bug#494001; Package initscripts. (Wed, 09 Nov 2011 06:39:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>. (Wed, 09 Nov 2011 06:39:04 GMT) Full text and rfc822 format available.

Message #220 received at 494001@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: Roger Leigh <rleigh@codelibre.net>, 494001@bugs.debian.org
Cc: pkg-sysvinit-devel@lists.alioth.debian.org
Subject: Re: Bug#494001: debian-installer: /etc/mtab must be a symlink to /proc/mounts with linux >= 2.6.26
Date: Wed, 09 Nov 2011 07:37:04 +0100
[Roger Leigh]
> It is now.

OK with me.  Sound like the issue I am aware of is taken care of.
Unless someone else have any objections, go ahead with fixing it. :)

Will be great to get mtab out of /etc/, where it do not belong.
-- 
Happy hacking
Petter Reinholdtsen




Added tag(s) pending and fixed-upstream. Request was from Roger Leigh <rleigh@codelibre.net> to control@bugs.debian.org. (Wed, 07 Dec 2011 11:33:03 GMT) Full text and rfc822 format available.

Reply sent to Roger Leigh <rleigh@debian.org>:
You have taken responsibility. (Wed, 14 Dec 2011 00:09:07 GMT) Full text and rfc822 format available.

Notification sent to Roger Leigh <rleigh@debian.org>:
Bug acknowledged by developer. (Wed, 14 Dec 2011 00:09:07 GMT) Full text and rfc822 format available.

Message #227 received at 494001-close@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@debian.org>
To: 494001-close@bugs.debian.org
Subject: Bug#494001: fixed in sysvinit 2.88dsf-14
Date: Wed, 14 Dec 2011 00:06:30 +0000
Source: sysvinit
Source-Version: 2.88dsf-14

We believe that the bug you reported is fixed in the latest version of
sysvinit, which is due to be installed in the Debian FTP archive:

initscripts_2.88dsf-14_amd64.deb
  to main/s/sysvinit/initscripts_2.88dsf-14_amd64.deb
sysv-rc_2.88dsf-14_all.deb
  to main/s/sysvinit/sysv-rc_2.88dsf-14_all.deb
sysvinit-utils_2.88dsf-14_amd64.deb
  to main/s/sysvinit/sysvinit-utils_2.88dsf-14_amd64.deb
sysvinit_2.88dsf-14.debian.tar.gz
  to main/s/sysvinit/sysvinit_2.88dsf-14.debian.tar.gz
sysvinit_2.88dsf-14.dsc
  to main/s/sysvinit/sysvinit_2.88dsf-14.dsc
sysvinit_2.88dsf-14_amd64.deb
  to main/s/sysvinit/sysvinit_2.88dsf-14_amd64.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 494001@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Roger Leigh <rleigh@debian.org> (supplier of updated sysvinit package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Format: 1.8
Date: Tue, 13 Dec 2011 20:11:48 +0000
Source: sysvinit
Binary: sysvinit sysvinit-utils sysv-rc initscripts
Architecture: source amd64 all
Version: 2.88dsf-14
Distribution: experimental
Urgency: low
Maintainer: Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org>
Changed-By: Roger Leigh <rleigh@debian.org>
Description: 
 initscripts - scripts for initializing and shutting down the system
 sysv-rc    - System-V-like runlevel change mechanism
 sysvinit   - System-V-like init utilities
 sysvinit-utils - System-V-like utilities
Closes: 494001 580579 631077 641107 643558 645655 648472 648881
Changes: 
 sysvinit (2.88dsf-14) experimental; urgency=low
 .
   [ Kel Modderman ]
   * Add support for s390x, thanks to Aurelien Jarno <aurel32@debian.org>.
     (Closes: #641107)
 .
   [ Roger Leigh ]
   * debian/rules:
     - Add build-arch and -indep rules. (Closes: #648472)
     - Remove dpatch usage.
     - Use dh and debhelper compat level 9.
   * debian/control:
     - Add git version control information.
     - Upgrade to Standards-Version 3.9.2.
     - Add myself to Uploaders.
   * Use dpkg 3.0 (quilt) source format.  Rediffed
     debian/patches/40_multiarch_libcrypt.patch which was not well
     formed and failed to apply.
   * initscripts:
     - Make /etc/mtab a symlink to /proc/mounts. (Closes: #494001)
       Note that this is only done when the root filesystem is writable
       and /proc/mount is readable.
     - Support the ceph network filesystem. (Closes: #580579).  Thanks
       to Sage Weil.
     - Restore boot-time cleaning of /var/run and /var/lock, used by
       systems which currently do not use a tmpfs for /run.
     - Remove /lib/init/rw: Add Breaks for all packages which used
       /lib/init/rw, and which now use /run.  Unmount and remove
       following upgrade.
     - Don't create /run/.run-transition on upgrade, only on actually
       setting up a transitional bind mount.
     - Add Breaks on all packages previously using /lib/init/rw, in
       order to permit removal of /lib/init/rw.  It is not possible to
       remove prior to rebooting due to initscripts being required to
       be configured by the packages transitioning to /run.  Remove in
       wheezy+1.
     - Remove trailing period from the initscripts init script log
       message.  (Closes: #648881).  Thanks to Clint Byrum.
     - /etc/network/if-up.d/mountnfs: grep: character class syntax is
       [[:space:]], not [:space:]. (Closes: #631077, #645655).  Thanks to
       Milan Kocian and Jan-Benedict Glaw.  Also simplify function logic
       using a for loop rather than a while loop.  Thanks to Corey Hickey.
   * sysv-rc:
     - Remove splash support and use of removed /dev/.initramfs.
       (Closes: #643558).  Thanks to Michael Biebl.
Checksums-Sha1: 
 c99ad29dcaeb1b76d6324280182f1cdb46a63ef1 1658 sysvinit_2.88dsf-14.dsc
 deaa4b242547c2e15e040e7d8dcf77a63b7c856d 179693 sysvinit_2.88dsf-14.debian.tar.gz
 77344603320a45ed082119973b979fbcf2ac697b 126042 sysvinit_2.88dsf-14_amd64.deb
 635eabd209b03ee5c7be5b5533285d8b97fbb712 92634 sysvinit-utils_2.88dsf-14_amd64.deb
 05430b4d1dfe1917d7944113102f762ce702ebfc 78838 sysv-rc_2.88dsf-14_all.deb
 b34f0551441c0d6958066dcaee15bb75b3d28594 78100 initscripts_2.88dsf-14_amd64.deb
Checksums-Sha256: 
 286be117e29341ec379f0953c21789f50dd79e896e5192bf767b73ad900a8334 1658 sysvinit_2.88dsf-14.dsc
 b97d13b22632623cfcdb18f042b30f7d96ec0576e6b0afbe0bb2bc7b4cb9de8f 179693 sysvinit_2.88dsf-14.debian.tar.gz
 925456df2c813bd7e10c50608f1f66666cac43e70d1c2bde21709199c9c10a29 126042 sysvinit_2.88dsf-14_amd64.deb
 cd18cf381e50daf3d9b1be61760d894d74fe46d321dc5dc8f6cd64637e3df4a2 92634 sysvinit-utils_2.88dsf-14_amd64.deb
 747b601e4a3473479594dbb71ed366686b6b085c4fac7ee4f39c67bb2b43a8bd 78838 sysv-rc_2.88dsf-14_all.deb
 bf1f38adf3a44862c0f5bac6bc2228d2ea9bf906720d4c8502ef6ae794d02825 78100 initscripts_2.88dsf-14_amd64.deb
Files: 
 0771dbb94fa0f523a0e017695d6e5d6f 1658 admin required sysvinit_2.88dsf-14.dsc
 f94f337260cc42d68df0156532ced47b 179693 admin required sysvinit_2.88dsf-14.debian.tar.gz
 a45cfb3dec781a8279d42d71e238148c 126042 admin required sysvinit_2.88dsf-14_amd64.deb
 226a422680673618f0771f733fc21dca 92634 admin required sysvinit-utils_2.88dsf-14_amd64.deb
 705c7c15608fb9fedc4b23024f479941 78838 admin required sysv-rc_2.88dsf-14_all.deb
 72e2e64c0c4365eed0da7ac2aa3cf617 78100 admin required initscripts_2.88dsf-14_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEAREDAAYFAk7n4z8ACgkQVcFcaSW/uEiDMQCfZLC/+yYPV/dOZwi809FXrgre
+xEAoKGf5tRJuIul88u0gxEwy+q8dCE9
=g7cC
-----END PGP SIGNATURE-----





Reply sent to Roger Leigh <rleigh@debian.org>:
You have taken responsibility. (Wed, 14 Dec 2011 00:09:08 GMT) Full text and rfc822 format available.

Notification sent to Jonathan Nieder <jrnieder@gmail.com>:
Bug acknowledged by developer. (Wed, 14 Dec 2011 00:09:08 GMT) Full text and rfc822 format available.

Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Mon, 16 Jan 2012 07:29:54 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 14:03:05 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.