diff options
-rw-r--r-- | initscripts.spec | 5 | ||||
-rw-r--r-- | rc.d/init.d/functions | 12 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup-eth | 18 |
3 files changed, 25 insertions, 10 deletions
diff --git a/initscripts.spec b/initscripts.spec index 8b69c75f..891c6352 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -6,7 +6,7 @@ Version: 9.15 # ppp-watch is GPLv2+, everything else is GPLv2 License: GPLv2 and GPLv2+ Group: System Environment/Base -Release: 1%{?dist} +Release: 1.1%{?dist} URL: http://fedorahosted.org/releases/i/n/initscripts/ Source: http://fedorahosted.org/releases/i/n/initscripts/initscripts-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -242,6 +242,9 @@ rm -rf $RPM_BUILD_ROOT /etc/profile.d/debug* %changelog +* Tue Jul 20 2010 Petr Lautrbach <plautrba@redhat.com> 9.15-1.1 +- experimental change of echo Error to echo_log + * Thu Jun 24 2010 Bill Nottingham <notting@redhat.com> - 9.15-1 - ifup-eth: check for dhclient configuration in /etc/dhcp as well (#607764, #607766) - network-functions: handle quoted SUBCHANNELS (#607481) diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 15fc6415..04c8a494 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -766,3 +766,15 @@ init_crypto() { # A sed expression to filter out the files that is_ignored_file recognizes __sed_discard_ignored_files='/\(~\|\.bak\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d' + +# echo and log message to syslog with priority and tag +# echo_log <priority> <tag> <message> +echo_log () { + local priority tag + + priority=$1 + tag=$2 + shift 2 + + echo $* && /usr/bin/logger -p $priority -t $tag $* +} diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth index cae00783..644971cf 100755 --- a/sysconfig/network-scripts/ifup-eth +++ b/sysconfig/network-scripts/ifup-eth @@ -40,7 +40,7 @@ is_available ${REALDEVICE} if [ -n "${HWADDR}" ]; then FOUNDMACADDR=$(get_hwaddr ${REALDEVICE}) if [ "${FOUNDMACADDR}" != "${HWADDR}" -a "${FOUNDMACADDR}" != "${MACADDR}" ]; then - echo $"Device ${DEVICE} has different MAC address than expected, ignoring." + echo_log daemon.error net_log $"Device ${DEVICE} has different MAC address than expected, ignoring." exit 1 fi fi @@ -48,7 +48,7 @@ fi # If the device is a bridge, create it with brctl, if available. if [ "${TYPE}" = "Bridge" ]; then if [ ! -x /usr/sbin/brctl ]; then - echo $"Bridge support not available: brctl not found" + echo_log daemon.error net_log $"Bridge support not available: brctl not found" exit 1 fi if [ ! -d /sys/class/net/${DEVICE}/bridge ]; then @@ -61,7 +61,7 @@ fi # If the device is a tap device, create it with tunctl, if available. if [ "${TYPE}" = "Tap" ]; then if [ ! -x /usr/sbin/tunctl ]; then - echo $"Tap support not available: tunctl not found" + echo_log daemon.error net_log $"Tap support not available: tunctl not found" exit 1 fi [ -n "${OWNER}" ] && OWNER="-u ${OWNER}" @@ -71,9 +71,9 @@ fi # now check the real state is_available ${REALDEVICE} || { if [ -n "$alias" ]; then - echo $"$alias device ${DEVICE} does not seem to be present, delaying initialization." + echo_log daemon.error net_log $"$alias device ${DEVICE} does not seem to be present, delaying initialization." else - echo $"Device ${DEVICE} does not seem to be present, delaying initialization." + echo_log daemon.error net_log $"Device ${DEVICE} does not seem to be present, delaying initialization." fi exit 1 } @@ -188,7 +188,7 @@ if [ -n "${DYNCONFIG}" ] && [ -x /sbin/dhclient ]; then echo echo -n $"Determining IP information for ${DEVICE}..." if [[ "${PERSISTENT_DHCLIENT}" != [yY1]* ]] && check_link_down ${DEVICE}; then - echo $" failed; no link present. Check cable?" + echo_log daemon.error net_log $" failed; no link present. Check cable?" exit 1 fi @@ -219,7 +219,7 @@ else ip link set dev ${REALDEVICE} $(toggle_value arp $ARP) if ! ip link set dev ${REALDEVICE} up ; then - echo $"Failed to bring up ${DEVICE}." + echo_log daemon.error net_log $"Failed to bring up ${DEVICE}." exit 1 fi @@ -244,12 +244,12 @@ else if [ "${REALDEVICE}" != "lo" ]; then if ! LC_ALL=C ip addr ls ${REALDEVICE} | LC_ALL=C grep -q "${IPADDR}/${PREFIX}" ; then if ! /sbin/arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; then - echo $"Error, some other host already uses address ${IPADDR}." + echo_log daemon.error net_log $"Error, some other host already uses address ${IPADDR}." exit 1 fi if ! ip addr add ${IPADDR}/${PREFIX} \ brd ${BROADCAST:-+} dev ${REALDEVICE} ${SCOPE} label ${DEVICE}; then - echo $"Error adding address ${IPADDR} for ${DEVICE}." + echo_log daemon.error net_log $"Error adding address ${IPADDR} for ${DEVICE}." fi fi |