Bug 623545

Summary: mount.tmpfs emits 'id: command not found' error messages at boot time
Product: [Fedora] Fedora Reporter: Bruce Jerrick <bmj001>
Component: coreutilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: aquini, kdudka, kzak, ovasik, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-08-12 13:18:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bruce Jerrick 2010-08-12 05:53:15 UTC
Description of problem:
/sbin/mount.tmpfs will emit error messages at boot time, and fails to turn
off restricted mode, if two conditions are met:
    1. A tmpfs filesystem is used (listed in /etc/fstab).
    2. /usr is a separate filesystem, mounted after a tmpfs filesystem.
The problem is simply that /sbin/mount.tmpfs uses 'id', which is in
/usr/bin/id, and hence not yet available.

Version-Release number of selected component (if applicable):
coreutils-8.4-8.fc13.i686
(The error message is emitted by /sbin/mount.tmpfs, but the easy fix is
to coreutils; see "Additional info" below.)

How reproducible:
100%

Steps to Reproduce:
Prerequisites:
  A tmpfs filesystem in /etc/fstab, e.g.:
      tmpfs  /tmp  tmpfs  defaults  0 0
  A separate /usr filesystem, listed after tmpfs in /etc/fstab .
Then boot (single-user will do).

Actual results:
On the system console (also in /var/log/boot.log):
  Mounting local filesystems:  /sbin/mount.tmpfs: line 22: id: command not found
  /sbin/mount.tmpfs: line 23: id: command not found
  /sbin/mount.tmpfs: line 25: [: -eq: unary operator expected

Expected results:
No error messages after "Mounting local filesystems".

Additional info:
Two possibilities to fix:
1. Change the location of 'id' from /usr/bin/id to /bin/id, in the coreutils
   package.
2. Make all the 'id' code in /sbin/mount.tmpfs be conditional on
   'type -t id >/dev/null', and if that fails, assume it's boot time, and
   set restricted=0 .  (No, I don't like it either.)

Comment 1 Bruce Jerrick 2010-08-12 05:56:46 UTC
It looks like the use of 'id' was introduced with rhbz 616393 .

Comment 2 Ondrej Vasik 2010-08-12 08:26:08 UTC
well... there are several binaries in coreutils which were moved from /usr/bin to /bin ... most recent one was readlink. Solution with keeping symlink in /usr/bin and moving binary into /bin is safe enough, however I don't want to polute /bin with more binaries. Anyway, id doesn't depend on anything from /usr/lib, so it is safe to move it.

Karel, as you are the maintainer of /sbin/mount.tmpfs ... which possibility do you prefer?

Comment 3 Karel Zak 2010-08-12 13:11:46 UTC
oh... I don't need id(1) at all (see bug #620924). The bash provides all necessary information in $UID and $EUID. From my point of view you can close this issue.

Comment 4 Ondrej Vasik 2010-08-12 13:18:48 UTC
Ok, thanks ... closing duplicate...

*** This bug has been marked as a duplicate of bug 620924 ***