Bug 220318 - /etc/sysconfig/network-scripts/ifup-post has bug
Summary: /etc/sysconfig/network-scripts/ifup-post has bug
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: 6
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-12-20 13:13 UTC by Hiroshi Fujishima
Modified: 2014-03-17 03:04 UTC (History)
1 user (show)

Fixed In Version: 8.50-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-01-17 18:52:38 UTC
Type: ---
Embargoed:


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

Description Hiroshi Fujishima 2006-12-20 13:13:20 UTC
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 18:50:11 UTC
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 06:37:07 UTC
> 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.