Alien Bob |
04-16-2010 06:38 PM |
Quote:
Originally Posted by hello.freeman
(Post 3938059)
======================================================================
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
|