Bug 126871 - ifup ipsec0 gives usage message instead of bringing up interface
ifup ipsec0 gives usage message instead of bringing up interface
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: initscripts (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-06-28 12:34 EDT by Graham Leggett
Modified: 2014-03-16 22:46 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-06-29 01:16:30 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Graham Leggett 2004-06-28 12:34:47 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040623

Description of problem:
If the instructions at
http://kbase.redhat.com/faq/dml_fetch.pl?CompanyID=842&ContentID=1073&FaqID=988&word=ipsec&faq_template=http://kbase.redhat.com/faq/searchfaq.shtm&topic=44&back_refr=http://kbase.redhat.com/faq/&topicname=2.1/3%20-%20Security&Id=&Instance=&Shared=
are followed in order to set up an IPsec connection (minus the DST
option, as the peer's IP is dynamic) and an attempt is made to bring
up this interface, the following happens:

[root@chandler boot]# /sbin/ifup ipsec0
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
Missing config file ifcfg-ifcfg-ipsec0.

Either the docs are broken, or ifup is broken.

In addition, ifup is missing a man page that might hint at what is wrong:

[root@chandler boot]# man ifup
No manual entry for ifup


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


How reproducible:
Always

Steps to Reproduce:
xxx

Additional info:
Comment 1 Graham Leggett 2004-06-28 14:12:09 EDT
Running sh -x /sbin/ifup ipsec0 gives the following output:

[root@chandler boot]# sh -x /sbin/ifup ipsec0
+ . /etc/init.d/functions
++ TEXTDOMAIN=initscripts
++ umask 022
++ PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
++ export PATH
++ '[' -z '' ']'
++ COLUMNS=80
++ '[' -z '' ']'
+++ /sbin/consoletype
++ CONSOLETYPE=pty
++ '[' -f /etc/sysconfig/i18n -a -z '' ']'
++ . /etc/sysconfig/i18n
+++ LANG=en_US
+++ SYSFONT=lat0-sun16
+++ SYSFONTACM=iso01
++ '[' pty '!=' pty ']'
++ export LANG
++ '[' -z '' ']'
++ '[' -f /etc/sysconfig/init ']'
++ . /etc/sysconfig/init
+++ BOOTUP=color
+++ GRAPHICAL=yes
+++ RES_COL=60
+++ MOVE_TO_COL=echo -en \033[60G
+++ SETCOLOR_SUCCESS=echo -en \033[0;32m
+++ SETCOLOR_FAILURE=echo -en \033[0;31m
+++ SETCOLOR_WARNING=echo -en \033[0;33m
+++ SETCOLOR_NORMAL=echo -en \033[0;39m
+++ LOGLEVEL=3
+++ PROMPT=yes
++ '[' pty = serial ']'
++ '[' color '!=' verbose ']'
++ INITLOG_ARGS=-q
+ cd /etc/sysconfig/network-scripts
+ . network-functions
++ PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
++ export PATH
+ '[' -f ../network ']'
+ . ../network
++ NETWORKING=yes
++ FORWARD_IPV4=false
++ HOSTNAME=chandler.sharp.fm
++ DOMAINNAME=sharp.fm
++ GATEWAY=164.49.223.129
++ GATEWAYDEV=eth0
+ CONFIG=ipsec0
+ '[' -z ipsec0 ']'
+ need_config ipsec0
+ CONFIG=ifcfg-ipsec0
+ '[' -f ifcfg-ipsec0 ']'
+ return
+ '[' -f ifcfg-ipsec0 ']'
+ '[' 0 '!=' 0 ']'
+ source_config
++ basename ifcfg-ipsec0
++ sed 's/^ifcfg-//g'
+ DEVNAME=ipsec0
+ basename ifcfg-ipsec0
+ grep -q '[^g]-'
+ . ifcfg-ipsec0
++ TYPE=IPsec
++ ONBOOT=yes
++ IKE_METHOD=PSK
++ SRCGW=164.49.223.165
++ DSTGW=164.39.8.208
++ SRCNET=164.49.223.165/32
++ DSTNET=164.39.8.208/32
++ DST=
+ '[' -f keys-ipsec0 ']'
+ . keys-ipsec0
+ '[' -z '' ']'
++ echo
++ sed 's/[0-9]*$//'
+ DEVICETYPE=
+ '[' -z '' -a -n '' ']'
+ '[' -z '' ']'
+ REALDEVICE=
+ '[' '' '!=' '' ']'
+ ISALIAS=no
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' foo = fooboot -a yes = no -o yes = NO ']'
+ '[' -n '' -a '' = no -o '' = NO ']'
+ '[' -x /sbin/vconfig -a '' = yes ']'
+ '[' '' = yes ']'
+ '[' '' = bootp -o '' = dhcp ']'
+ '[' -x /sbin/ifup-pre-local ']'
+ OTHERSCRIPT=/etc/sysconfig/network-scripts/ifup-
+ '[' -x /etc/sysconfig/network-scripts/ifup- ']'
+ is_available
+ LC_ALL=
+ LANG=
+ ip -o link
+ grep -q
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
+ '[' 2 = 1 ']'
+ return 0
+ '[' -n '' ']'
+ is_available
+ LC_ALL=
+ LANG=
+ ip -o link
+ grep -q
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
+ '[' 2 = 1 ']'
+ return 0
+ is_wireless_device
+ '[' -x /sbin/iwconfig ']'
+ return 1
+ '[' '' = yes -a no = no -a '' '!=' '' -a -x /sbin/ifenslave ']'
+ '[' IPsec = Bonding ']'
+ ethtool -i
+ grep -q 'driver: bonding'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ FWACTIVE=
+ iptables -L -n
+ LC_ALL=C
+ grep -q RH-Lokkit-0-50-INPUT
+ modprobe -r iptable_filter
+ '[' -w /etc/dhclient-.conf ']'
+ '[' -n '' ']'
+ '[' -z '' ']'
+ ip link set dev up
+ '[' '' = yes ']'
+ exec /etc/sysconfig/network-scripts/ifup-post ifcfg-ipsec0
Missing config file ifcfg-ifcfg-ipsec0.
Comment 2 Graham Leggett 2004-06-28 14:31:18 EDT
Turns out the cause of the error is a missing DEVICE environment
variable (which are omitted from the knowledgebase instructions).

The correct behaviour should be to test whether DEVICE is empty, and
throw an error accordingly.
Comment 3 Bill Nottingham 2004-06-29 01:16:30 EDT
Hm, the knowledgebase entry should really be updated. Files without a
DEVICE line have been invalid in the entire history of RHL and RHEL.
Comment 4 Sergey Svishchev 2009-04-23 04:54:50 EDT
Yes, http://kbase.redhat.com/faq/docs/DOC-9048 should really be updated.

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