Bug 301481 - /etc/profile errors when /bin/hostname not present
/etc/profile errors when /bin/hostname not present
Product: Fedora
Classification: Fedora
Component: setup (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Ondrej Vasik
Fedora Extras Quality Assurance
: EasyFix
Depends On:
  Show dependency treegraph
Reported: 2007-09-21 20:00 EDT by Jason Tibbitts
Modified: 2008-12-02 20:17 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-12-02 20:17:46 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jason Tibbitts 2007-09-21 20:00:47 EDT
I know this is almost hilariously minor, but when building things in mock
/bin/hostname is generally not present unless pulled in as a build dependency,
and lack of /bin/hostname causes some annoying spew in the resulting build logs:

/etc/profile: line 38: /bin/hostname: No such file or directory

I think it suffices to change
  HOSTNAME=`/bin/hostname 2>/dev/null`
in /etc/profile to quiet the error but I'm far from an expert in sh; I guess it
might be cleaner to conditionalize things based on the presense of
/bin/hostname.  I did patch this into my local setup package and everything
seemed to work well.
Comment 1 Phil Knirsch 2008-02-22 11:14:23 EST
Hi Jason.

If i remember correctly this has been fixed by now with better dependencies and
a proper basic set of packages for mock, right?

If not, let me know and i'll see what i can do. Completely suppressing the error
message here might not be desirable.

Read ya, Phil
Comment 2 Jason Tibbitts 2008-02-22 11:51:45 EST
Currently in rawhide, nothing in the default buildroot has a dependency on
net-tools, and so every mock build will still start out with
  /etc/profile: line 38: /bin/hostname: No such file or directory

Like I said, hilariously minor, but it is indeed still around.
Comment 3 Florian La Roche 2008-02-24 17:08:59 EST
Bash might already set this var automatically:
              Automatically set to the name of the current host.
Comment 4 Bug Zapper 2008-05-13 23:16:01 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
Comment 5 Ondrej Vasik 2008-11-18 07:20:26 EST
Added 2>/dev/null in rawhide, built as setup-2.7.4-2.fc11.
Comment 6 Fedora Update System 2008-11-18 10:31:36 EST
setup-2.6.18-1.fc9 has been submitted as an update for Fedora 9.
Comment 7 Fedora Update System 2008-11-19 09:50:37 EST
setup-2.6.18-1.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update setup'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-9727
Comment 8 Fedora Update System 2008-12-02 20:17:37 EST
setup-2.6.18-1.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.