Bug 220318 - /etc/sysconfig/network-scripts/ifup-post has bug
/etc/sysconfig/network-scripts/ifup-post has bug
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
6
All Linux
medium Severity high
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-12-20 08:13 EST by Hiroshi Fujishima
Modified: 2014-03-16 23:04 EDT (History)
1 user (show)

See Also:
Fixed In Version: 8.50-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-01-17 13:52:38 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
what's going in CVS (826 bytes, patch)
2007-01-17 13:50 EST, Bill Nottingham
no flags Details | Diff

  None (edit)
Description Hiroshi Fujishima 2006-12-20 08:13:20 EST
Description of problem:

If hostname is localhost.localdomain and IP address is statically allocated and
it can't be resolved, `search localdomain' line is automatically added in
/etc/resolv.conf.

Version-Release number of selected component (if applicable):

initscripts-8.45.3-1

How reproducible:

Steps to Reproduce:
1. /etc/sysconfig/network contain `HOSTNAME=localhost.localdomain' line. 
2. IP address is statically allocated(don't use DHCP).
3. IP address setted in 2 has not PTR recoed.
4. /etc/resolv.conf has not line which beginning search
5. reboot

Actual results:

/etc/resolv.conf has `search localdomain' line.

Expected results:

/etc/resolv.conf has not `search localdomain' line.

Additional info:

the patch below solve the problem.

[root@localhost ~]# diff -u /etc/sysconfig/network-scripts/ifup-post{~,}
--- /etc/sysconfig/network-scripts/ifup-post~   2006-09-12 02:15:01.000000000 +0900
+++ /etc/sysconfig/network-scripts/ifup-post    2006-12-20 21:58:26.000000000 +0900
@@ -87,8 +87,8 @@
     if need_hostname; then
        IPADDR=`LANG= LC_ALL= ifconfig ${DEVICE} | grep 'inet addr' |
                awk -F: '{ print $2 } ' | awk '{ print $1 }'`
-       eval `/bin/ipcalc --silent --hostname ${IPADDR}`
-       if [ "$?" = "0" ]; then
+       eval `/bin/ipcalc --silent --hostname ${IPADDR}; echo status=$?`
+       if [ "$status" = "0" ]; then
            set_hostname $HOSTNAME
        fi
     fi

[root@localhost ~]# /bin/ipcalc --silent --hostname 172.18.0.11
[root@localhost ~]# echo $?
1
[root@localhost ~]# eval `/bin/ipcalc --silent --hostname 172.18.0.11`
[root@localhost ~]# echo $?
0
[root@localhost ~]# eval `/bin/ipcalc --silent --hostname 172.18.0.11; echo
STATUS=$?`
[root@localhost ~]# echo $STATUS
1
Comment 1 Bill Nottingham 2007-01-17 13:50:11 EST
Created attachment 145847 [details]
what's going in CVS

I'm adding the following to CVS, will be in 8.50-1.
Comment 2 Hiroshi Fujishima 2007-02-02 01:37:07 EST
> what's going in CVS
> 
> I'm adding the following to CVS, will be in 8.50-1.

Could you please fix FC6-branch?

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