mounted-tmp fails to cleanup directories when /tmp contains undeletable files

Bug #1083130 reported by Andrea Corbellini on 2012-11-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mountall (Ubuntu)
Low
Unassigned

Bug Description

Assumption:
/tmp is an ext* filesystem.

Steps to reproduce:
1. mkdir /tmp/test
2. touch /tmp/test/case
3. chattr +a /tmp/test
4. shutdown -r now

What happens:
On start all files but /tmp/test/case are removed. No directories are removed.

What should happend:
Every file and directory in /tmp should be removed, except /tmp/test and its content.

Why it happens:
/etc/init/mounted-tmp.conf contains these two lines:

    find . -depth -xdev $TEXPR $EXCEPT ! -type d -delete
    find . -depth -xdev $DEXPR $EXCEPT -type d -empty -delete

The first line fails with a non-zero status because unlink("/tmp/test/case") triggers EPERM. AFAIK, all upstart scripts implicitly use "set +e", so the second line will never be executed (and no directories will be removed).

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: mountall 2.42ubuntu0.1
ProcVersionSignature: Ubuntu 3.5.0-19.30-generic 3.5.7
Uname: Linux 3.5.0-19-generic x86_64
ApportVersion: 2.6.1-0ubuntu6
Architecture: amd64
CheckboxSubmission: 23d4ad9b5457fd302024f47052e863ca
CheckboxSystem: d00f84de8a555815fa1c4660280da308
Date: Mon Nov 26 12:10:04 2012
InstallationDate: Installed on 2011-10-17 (405 days ago)
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
MarkForUpload: True
SourcePackage: mountall
UpgradeStatus: Upgraded to quantal on 2012-08-25 (92 days ago)

Steve Langasek (vorlon) on 2012-11-27
Changed in mountall (Ubuntu):
status: New → Triaged
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers