Bug 7028 - HOSTNAME environment variable not set
Summary: HOSTNAME environment variable not set
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Networking (show other bugs)
Version: 1.21.x
Hardware: Other Linux
: P5 enhancement
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-13 05:23 UTC by Benjamin Shadwick
Modified: 2014-04-15 09:44 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Shadwick 2014-04-13 05:23:54 UTC
Background:
- Running BusyBox v1.21.1 as part of a firmware load on a mips-based Asus router/gateway.
- This build appears to include ash and uname applets but not hostname.
- I am an end-user of the firmware and not its developer/maintainer.

It appears that the ash prompt and uname -n command are both able to determine what the hostname of the system is, but there is no environment variable (e.g. HOSTNAME or HOST) set by default for shell scripts to use.

My understanding is that other shells typically set one of these automatically as a built-in feature; it would be useful if HOSTNAME (or HOST) were set by default by busybox's ash as well.
Comment 1 Denys Vlasenko 2014-04-15 09:44:21 UTC
Fixed in git:

commit 3fa97af7ccc75264fb237f279f253eddf0ba4da1
Author: Denys Vlasenko <vda.linux@googlemail.com>
Date:   Tue Apr 15 11:43:29 2014 +0200

    ash,hush: set $HOSTNAME is bash compat