← Back to team overview

touch-packages team mailing list archive

[Bug 1444054] [NEW] Symbolic links are never removed from /tmp with TMPTIME>0

 

Public bug reported:

With TMPTIME set to anything other than 0 in /etc/default/rcS the init
script has to find files to remove rather than simply wiping /tmp. This
fails to remove symbolic links.

lrwxrwxrwx  1 1001     1001       12 Mar 20 02:01 test2.jpg -> download.jpg
lrwxrwxrwx  1 1001     1001        3 Mar 20 02:04 beh -> meh

$ file beh
beh: broken symbolic link to `meh'
$ file test2.jpg 
test2.jpg: broken symbolic link to `download.jpg'

My TMPTIME is set to 3 but these two files are well over a month old.

The script uses find but this seems to find the files no problem:

$ find . ! -type d 2>&- | egrep "beh|test2"
./beh
./test2.jpg

Tests using "find . ! -type d -delete" show "find" removing symbolic
links both working and broken.

My syslog does show this during boot:

kernel: [  723.500519] type=1302 audit(1429024710.712:73): item=0
name="/tmp/beh" inode=221577 dev=08:05 mode=0120777 ouid=1001 ogid=1001
rdev=00:00 nametype=NORMAL

This seems to be updating the atime, and the atime is used in the
expression:

TEXPR="-mtime +${TMPTIME} -ctime +${TMPTIME} -atime +${TMPTIME}"

The result being that symbolic links will, apparently, never be removed.

I have no idea what is updating the atime for these symbolic links or
why it is being audited. It's nothing I have intentionally set up on
this system. It may be that the script is not at fault here but whatever
package is updating the atime on these files.

A temporary solution would be to have a separate expression just for
symbolic links ignoring the atime, but this may not be what a user
wants. However: I can think of no good reason why anyone would need a
symbolic link hanging around /tmp for longer than the TMPTIME.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: initscripts 2.88dsf-13.10ubuntu11.1
ProcVersionSignature: Ubuntu 3.11.0-26.45~precise1-generic 3.11.10.12
Uname: Linux 3.11.0-26-generic i686
NonfreeKernelModules: nvidia
ApportVersion: 2.0.1-0ubuntu17.8
Architecture: i386
Date: Tue Apr 14 16:46:52 2015
MarkForUpload: True
ProcEnviron:
 LANGUAGE=en_GB:en
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: sysvinit
UpgradeStatus: Upgraded to precise on 2014-12-07 (128 days ago)

** Affects: sysvinit (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: apport-bug i386 precise

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to sysvinit in Ubuntu.
https://bugs.launchpad.net/bugs/1444054

Title:
  Symbolic links are never removed from /tmp with TMPTIME>0

Status in sysvinit package in Ubuntu:
  New

Bug description:
  With TMPTIME set to anything other than 0 in /etc/default/rcS the init
  script has to find files to remove rather than simply wiping /tmp.
  This fails to remove symbolic links.

  lrwxrwxrwx  1 1001     1001       12 Mar 20 02:01 test2.jpg -> download.jpg
  lrwxrwxrwx  1 1001     1001        3 Mar 20 02:04 beh -> meh

  $ file beh
  beh: broken symbolic link to `meh'
  $ file test2.jpg 
  test2.jpg: broken symbolic link to `download.jpg'

  My TMPTIME is set to 3 but these two files are well over a month old.

  The script uses find but this seems to find the files no problem:

  $ find . ! -type d 2>&- | egrep "beh|test2"
  ./beh
  ./test2.jpg

  Tests using "find . ! -type d -delete" show "find" removing symbolic
  links both working and broken.

  My syslog does show this during boot:

  kernel: [  723.500519] type=1302 audit(1429024710.712:73): item=0
  name="/tmp/beh" inode=221577 dev=08:05 mode=0120777 ouid=1001
  ogid=1001 rdev=00:00 nametype=NORMAL

  This seems to be updating the atime, and the atime is used in the
  expression:

  TEXPR="-mtime +${TMPTIME} -ctime +${TMPTIME} -atime +${TMPTIME}"

  The result being that symbolic links will, apparently, never be
  removed.

  I have no idea what is updating the atime for these symbolic links or
  why it is being audited. It's nothing I have intentionally set up on
  this system. It may be that the script is not at fault here but
  whatever package is updating the atime on these files.

  A temporary solution would be to have a separate expression just for
  symbolic links ignoring the atime, but this may not be what a user
  wants. However: I can think of no good reason why anyone would need a
  symbolic link hanging around /tmp for longer than the TMPTIME.

  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: initscripts 2.88dsf-13.10ubuntu11.1
  ProcVersionSignature: Ubuntu 3.11.0-26.45~precise1-generic 3.11.10.12
  Uname: Linux 3.11.0-26-generic i686
  NonfreeKernelModules: nvidia
  ApportVersion: 2.0.1-0ubuntu17.8
  Architecture: i386
  Date: Tue Apr 14 16:46:52 2015
  MarkForUpload: True
  ProcEnviron:
   LANGUAGE=en_GB:en
   TERM=xterm
   PATH=(custom, no user)
   LANG=en_GB.UTF-8
   SHELL=/bin/bash
  SourcePackage: sysvinit
  UpgradeStatus: Upgraded to precise on 2014-12-07 (128 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/1444054/+subscriptions


Follow ups

References