Bug 301481

Summary: /etc/profile errors when /bin/hostname not present
Product: [Fedora] Fedora Reporter: Jason Tibbitts <j>
Component: setupAssignee: Ondrej Vasik <ovasik>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9Keywords: EasyFix
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: 2008-12-03 01:17:46 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 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.