Bug 1072260
| Summary: | HOSTNAME is not defined | ||
|---|---|---|---|
| Product: | [Retired] Beaker | Reporter: | Jan Stancek <jstancek> |
| Component: | beah | Assignee: | beaker-dev-list |
| Status: | CLOSED WORKSFORME | QA Contact: | tools-bugs <tools-bugs> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 0.15 | CC: | aigao, bpeck, dcallagh, ebaak, jburke, jstancek, pbunyan, rjoost, tools-bugs |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-11-09 14:13:25 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Jan Stancek
2014-03-04 08:55:23 UTC
This check is coming from rhts-test-runner.sh: 114 if [ -z "$HOSTNAME" ]; then 115 echo "HOSTNAME is not defined" 116 exit 1 117 fi $HOSTNAME should be set by bash to the system hostname, I'm not sure why it would not have been set (or perhaps, set to empty string). $HOSTNAME is also set by rhts-environment.sh, for some reason, but that would be after the check in rhts-test-runner.sh happens. On the console log for your job I can see that systemd claimed to set the hostname to the correct value on every reboot. HOSTNAME is exported in /etc/profile, which makes this a bit more complicated to test -- HOSTNAME will be set in the environment of login shells, but otherwise not. If HOSTNAME is not set in the environment, bash populates it as an internal shell variable only (not exported). That means the usual case for rhts-test-runner.sh is HOSTNAME is not set in the environment, it's a shell variable populated by bash on startup. So I think in this case, gethostname(3) in bash was returning empty string. It happened in every invocation of rhts-test-runner.sh after that last reboot, so it was not just some one-off. For gethostname(3) to return empty string it must mean that either: 1. systemd did not set the hostname as it claimed 2. something else set the hostname to empty string after systemd set it 3. a kernel/glibc bug caused it to return empty string instead of the set hostname None of these seem particularly likely, so I'm not sure how this could happen. Jan, have you seen this on any other jobs besides that one? I don't recall seeing this in last 6 months. Closing. |