LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-16-2010, 06:24 PM   #1
hello.freeman
Member
 
Registered: Apr 2010
Posts: 38

Rep: Reputation: 23
Talking Some fixes for slackware 13.0


======================================================================
Code:
FILE : /etc/profile

### problem: The value of "INPUTRC" always be '/etc/inputrc'.
#---------------------no fix-----------------------

if [ ! -r "$HOME/.inputrc" ]; then
  export INPUTRC=/etc/inputrc
fi
##-------------------no fix-----------------------##


I think the code should be changed as follow :
#-----------------------fixed----------------------

if [ ! -r "$HOME/.inputrc" ]; then
  export INPUTRC=/etc/inputrc
else
  export INPUTRC="$HOME/.inputrc"
fi
##----------------------fixed--------------------##
========================================================================

Code:
FILE : /etc/rc.d/rc.inet1

### problem: It should detect the same ip address on the lan before setting ip address for interface.
#---------------------no fix-----------------------
          # Set up the network card:
          echo "/etc/rc.d/rc.inet1:  /sbin/ifconfig ${1} ${IPADDR[$i]} broadcast ${BROADCAST[$i]} netmask ${NETMASK[$i]}" | $LOGGER
          /sbin/ifconfig ${1} ${IPADDR[$i]} broadcast ${BROADCAST[$i]} netmask ${NETMASK[$i]}
        else
          if [ "$DEBUG_ETH_UP" = "yes" ]; then
            echo "/etc/rc.d/rc.inet1:  ${1} interface is not configured in /etc/rc.d/rc.inet1.conf" | $LOGGER
          fi
        fi
##-------------------no fix-----------------------##



I think the code should be changed as follow :
#-----------------------fixed----------------------
          # Set up the network card:
	  /sbin/ip addr flush dev ${1}
	  /sbin/ifconfig ${1} up
	  /sbin/arping -D -w 2 -c 2 -I ${1} ${IPADDR[$i]} 1> /dev/null
	  if [ $? -eq 0 ] ; then         # No ARP REPLY packets are received
		  echo "/etc/rc.d/rc.inet1:  /sbin/ifconfig ${1} ${IPADDR[$i]} broadcast ${BROADCAST[$i]} netmask ${NETMASK[$i]}" | $LOGGER
		  /sbin/ifconfig ${1} ${IPADDR[$i]} broadcast ${BROADCAST[$i]} netmask ${NETMASK[$i]}
	  else
		  if [ "$DEBUG_ETH_UP" = "yes" ]; then
			  echo "/etc/rc.d/rc.inet1:  The IP ${IPADDR[$i]} on ${1} interface has already used by other hosts" | $LOGGER
		  fi
	  fi
        else
          if [ "$DEBUG_ETH_UP" = "yes" ]; then
            echo "/etc/rc.d/rc.inet1:  ${1} interface is not configured in /etc/rc.d/rc.inet1.conf" | $LOGGER
          fi
        fi
##----------------------fixed--------------------##

========================================================================
 
Old 04-16-2010, 06:38 PM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 7,499

Rep: Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827
Quote:
Originally Posted by hello.freeman View Post
======================================================================
Code:
FILE : /etc/profile

### problem: The value of "INPUTRC" always be '/etc/inputrc'.
#---------------------no fix-----------------------

if [ ! -r "$HOME/.inputrc" ]; then
  export INPUTRC=/etc/inputrc
fi
##-------------------no fix-----------------------##


I think the code should be changed as follow :
#-----------------------fixed----------------------

if [ ! -r "$HOME/.inputrc" ]; then
  export INPUTRC=/etc/inputrc
else
  export INPUTRC="$HOME/.inputrc"
fi
##----------------------fixed--------------------##
Copied from the manpage:

Code:
Readline  is customized by putting commands in an initialization
file (the inputrc file).  The name of this file is taken  from the
value of the INPUTRC environment variable. If that variable is  unset,
the  default  is  ~/.inputrc.
So, the code in /etc/profile is correct.

Quote:
Code:
FILE : /etc/rc.d/rc.inet1

### problem: It should detect the same ip address on the lan before setting ip address for interface.
#---------------------no fix-----------------------
          # Set up the network card:
          echo "/etc/rc.d/rc.inet1:  /sbin/ifconfig ${1} ${IPADDR[$i]} broadcast ${BROADCAST[$i]} netmask ${NETMASK[$i]}" | $LOGGER
          /sbin/ifconfig ${1} ${IPADDR[$i]} broadcast ${BROADCAST[$i]} netmask ${NETMASK[$i]}
        else
          if [ "$DEBUG_ETH_UP" = "yes" ]; then
            echo "/etc/rc.d/rc.inet1:  ${1} interface is not configured in /etc/rc.d/rc.inet1.conf" | $LOGGER
          fi
        fi
##-------------------no fix-----------------------##



I think the code should be changed as follow :
#-----------------------fixed----------------------
          # Set up the network card:
	  /sbin/ip addr flush dev ${1}
	  /sbin/ifconfig ${1} up
	  /sbin/arping -D -w 2 -c 2 -I ${1} ${IPADDR[$i]} 1> /dev/null
	  if [ $? -eq 0 ] ; then         # No ARP REPLY packets are received
		  echo "/etc/rc.d/rc.inet1:  /sbin/ifconfig ${1} ${IPADDR[$i]} broadcast ${BROADCAST[$i]} netmask ${NETMASK[$i]}" | $LOGGER
		  /sbin/ifconfig ${1} ${IPADDR[$i]} broadcast ${BROADCAST[$i]} netmask ${NETMASK[$i]}
	  else
		  if [ "$DEBUG_ETH_UP" = "yes" ]; then
			  echo "/etc/rc.d/rc.inet1:  The IP ${IPADDR[$i]} on ${1} interface has already used by other hosts" | $LOGGER
		  fi
	  fi
        else
          if [ "$DEBUG_ETH_UP" = "yes" ]; then
            echo "/etc/rc.d/rc.inet1:  ${1} interface is not configured in /etc/rc.d/rc.inet1.conf" | $LOGGER
          fi
        fi
##----------------------fixed--------------------##
Nice touch, but if you are using static IP addresses you either hand them out yourself, or a LAN administrator hands them out. In both cases, you will have to do your administration properly. The Slackware init script should not compensate for sloppy IP assignment policies.
If you use DHCP, the problem you describe does not even exist.

This should not keep you from using your patch! The fun of Slackware is that you can make these modifications (almost) without penalty.

Eric
 
Old 04-16-2010, 07:11 PM   #3
hello.freeman
Member
 
Registered: Apr 2010
Posts: 38

Original Poster
Rep: Reputation: 23
Wink

Quote:
Originally Posted by Alien Bob View Post
Copied from the manpage:

Code:
Readline  is customized by putting commands in an initialization
file (the inputrc file).  The name of this file is taken  from the
value of the INPUTRC environment variable. If that variable is  unset,
the  default  is  ~/.inputrc.
So, the code in /etc/profile is correct.

Eric
I know that.
BUT in the slackware 13.0(bash version 3.1.17(2)-release),
If ~/.inputrc is readable, INPUTRC also is '/etc/inputrc', NOT '~/.inputrc'.

I think this should be bash's bug, isn't it ?

Last edited by hello.freeman; 04-16-2010 at 07:15 PM.
 
Old 04-16-2010, 07:20 PM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 7,499

Rep: Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827
Hm both man pages of bash in Slackware 13.0 (/bash-3.1.017) and Slackware-current (bash-4.1.002) state:
Code:
Readline is customized by putting commands in  an  initialization  file
(the  inputrc  file).  The name of this file is taken from the value of
the INPUTRC variable.  If  that  variable  is  unset,  the  default  is
~/.inputrc.
If you determined that the actual behaviour is different from what the man page tells me, then that would be a bash bug indeed.

How did you determine this?

Eric
 
Old 04-16-2010, 07:41 PM   #5
hello.freeman
Member
 
Registered: Apr 2010
Posts: 38

Original Poster
Rep: Reputation: 23
Talking

Quote:
Originally Posted by Alien Bob View Post
Hm both man pages of bash in Slackware 13.0 (/bash-3.1.017) and Slackware-current (bash-4.1.002) state:
Code:
Readline is customized by putting commands in  an  initialization  file
(the  inputrc  file).  The name of this file is taken from the value of
the INPUTRC variable.  If  that  variable  is  unset,  the  default  is
~/.inputrc.
If you determined that the actual behaviour is different from what the man page tells me, then that would be a bash bug indeed.

How did you determine this?

Eric
I am very sorry. I forgot to login the account again.
I ran the TerminalEmulator again after I modified '/etc/profile'.
This is a very funny mistake.
 
Old 04-16-2010, 07:42 PM   #6
hello.freeman
Member
 
Registered: Apr 2010
Posts: 38

Original Poster
Rep: Reputation: 23
Talking

thanks very much for your help
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SlackwareŽ LQ Announcements/Additions/Fixes/HotList For Linux Slackers! onebuck Slackware 30 10-29-2009 10:35 PM
Slackware 12.1 Complaints and Problem Fixes salemboot Slackware 13 06-24-2008 08:21 PM
Desktop Slackware 11 - Links to Fixes and Patches shepper Slackware 16 08-14-2006 10:06 PM
Keyboard/Mouse Input Freezes - Slackware 10 - Powerbutton fixes it johnp05 Linux - Hardware 0 08-22-2004 10:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration