Bug 301481 - /etc/profile errors when /bin/hostname not present
Summary: /etc/profile errors when /bin/hostname not present
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: setup
Version: 9
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Ondrej Vasik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-09-22 00:00 UTC by Jason Tibbitts
Modified: 2008-12-03 01:17 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-12-03 01:17:46 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jason Tibbitts 2007-09-22 00:00:47 UTC
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`
to
  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 16:14:23 UTC
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 16:51:45 UTC
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 22:08:59 UTC
Bash might already set this var automatically:
       HOSTNAME
              Automatically set to the name of the current host.


Comment 4 Bug Zapper 2008-05-14 03:16:01 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Ondrej Vasik 2008-11-18 12:20:26 UTC
Added 2>/dev/null in rawhide, built as setup-2.7.4-2.fc11.

Comment 6 Fedora Update System 2008-11-18 15:31:36 UTC
setup-2.6.18-1.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/setup-2.6.18-1.fc9

Comment 7 Fedora Update System 2008-11-19 14:50:37 UTC
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-03 01:17:37 UTC
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.