[Pkg-sysvinit-devel] Bug#719249: initscripts: mount-functions.sh creates .tmpfs files even when mounting fails

Matthijs Kooijman matthijs at tika.stderr.nl
Fri Aug 9 11:36:55 UTC 2013


Package: initscripts
Version: 2.88dsf-43
Severity: normal

Dear Maintainer,

Normally, the mount-functions.sh mounts /run, /tmp, etc as tmpfs
filesystems. To signal this fact to the other bootscripts, it creates a
".tmpfs" file inside.

However, when the mounting fails, and the corresponding filesystem has
thus _not_ been turned into a tmpfs, the .tmpfs file is still created.

In my case, this happened inside an lxc container. Because the mounting
capability was dropped for the container, mounting /run failed. However,
since .tmpfs was still created, the bootclean logic did not run, making
my container run with a dirty /run, causing all kinds of problems.

I looked at making a patch that made domount return a failure if the
(re)mount failed and made the mount_* functions only create .tmpfs files
if the mount succeeded.

However, I ran into two problems:
 - Currently, .tmpfs is also touched when the filesystem is only
   remounted, which probably doesn't make sense in the first place?
 - When there is already a mountpoint (e.g., /run mounted by initramfs),
   no mounting happens. I'd say this should make domount return failure
   and prevent creating .tmpfs.

   However, looking at the initramfs code, it seems that it mounts a
   tmpfs on /run but does _not_ create the .tmpfs file, so if
   mount_run doesn't create it, it will never be created in the
   initramfs case...

I wonder if it makes sense to actively check if /run (etc.) is a
mountpoint and look into /proc/mounts (or whatever is the best way for
this) to see if it is a tmpfs? Then this could just happen after the
mount and it doesn't matter if the mount failed or succeeded, or if the
filesystem was already a tmpfs to begin with.

Does that make sense?

Gr.

Matthijs


-- System Information:
Debian Release: 7.1
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.10-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages initscripts depends on:
ii  coreutils       8.13-3.5
ii  debianutils     4.3.2
ii  libc6           2.17-92
ii  lsb-base        4.1+Debian8+deb7u1
ii  mount           2.20.1-5.3
ii  sysv-rc         2.88dsf-41
ii  sysvinit-utils  2.88dsf-41

Versions of packages initscripts recommends:
ii  e2fsprogs  1.42.5-1.1
ii  psmisc     22.19-1+deb7u1

initscripts suggests no packages.

-- no debconf information



More information about the Pkg-sysvinit-devel mailing list