mounted-tmp uses 'find' -- but if /usr is not yet available it will fail
Bug #655447 reported by
C de-Avillez
This bug affects 52 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mountall (Ubuntu) |
Fix Released
|
Low
|
Clint Byrum |
Bug Description
Binary package hint: upstart
upstart 0.6.6-3, Maverick.
There is a chance of a race if /tmp and /usr are different filesystems (in my case, it is almost certain mounted-tmp will fail). mounted-tmp starts on mounted /tmp, but no sync is done to verify if /usr is already mounted. Then, then the 'find' line is executed, it is hit by an error, and the script exits with RC=127.
Of course, if /usr not a filesystem per se, no problems.
Related branches
lp:~clint-fewbar/ubuntu/natty/mountall/fix-mounted-tmp
- Kees Cook: Approve
-
Diff: 41 lines (+17/-1)2 files modifiedconf/mounted-tmp.conf (+10/-1)
debian/changelog (+7/-0)
To post a comment you must log in.
Carlos, thanks for the report. I can see where this will fail with a separate /usr. This is actually mountall's file though, not upstart's.
One just needs to use an OR and add a check:
start on (mounted MOUNTPOINT=/tmp) or (mounted MOUNTPOINT=/usr)
and then add this to the top
[ -x /usr/bin/find ] || exit 0
If /tmp is mounted before /usr, it will exit 0. if /usr is mounted before /tmp, then we'll just clear out the empty mount point for /tmp, which is actually a good thing. /tmp will be mounted later and we'll clear it out. If /tmp is not its own filesystem this also makes sure it gets cleaned up. Because mounted is a hook point, there's no parallelism to worry about.
Assigning to myself, merge proposal forthcoming.