aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d
diff options
context:
space:
mode:
Diffstat (limited to 'rc.d/init.d')
-rw-r--r--rc.d/init.d/netconsole22
1 files changed, 7 insertions, 15 deletions
diff --git a/rc.d/init.d/netconsole b/rc.d/init.d/netconsole
index 136bfb5f..b25fed81 100644
--- a/rc.d/init.d/netconsole
+++ b/rc.d/init.d/netconsole
@@ -34,7 +34,7 @@ kernel=`uname -r | cut -d. -f1-2`
usage ()
{
echo $"Usage: $0 {start|stop|status|restart|condrestart}" 1>&2
- RETVAL=1
+ RETVAL=3
}
print_address_info ()
@@ -59,35 +59,27 @@ print_address_info ()
fi
}
-netconsole_failure ()
-{
- echo -n "$1"
- failure
- echo
- exit 1
-}
-
start ()
{
- [ -f /etc/sysconfig/netconsole ] || exit 0
+ [ -f /etc/sysconfig/netconsole ] || exit 6
. /etc/sysconfig/netconsole
SYSLOGOPTS=
# syslogd server, if any
if [ -n "$SYSLOGADDR" ]; then
- if ! [[ "$SYSLOGADDR" =~ "^([0-9]{1,3}\.){3}[0-9]{1,3}$" ]]; then
- SYSLOGADDR=$(LANG=C host $SYSLOGADDR 2>/dev/null | awk '/has address / { print $NF }')
- fi
+ if ! [[ "$SYSLOGADDR" =~ "^([0-9]{1,3}\.){3}[0-9]{1,3}$" ]]; then
+ SYSLOGADDR=$(LANG=C host $SYSLOGADDR 2>/dev/null | awk '/has address / { print $NF }')
+ fi
fi
if [ -z "$SYSLOGADDR" ] ; then
echo $"Server address not specified in /etc/sysconfig/netconsole" 1>&2
- exit 1
+ exit 6
fi
eval $(print_address_info $SYSLOGADDR)
if [ -z "$SYSLOGMACADDR" ]; then
echo $"netconsole: can't resolve MAC address of $SYSLOGADDR" 1>&2
- netconsole_failure "syslog server address resolution"
+ exit 1
fi
SYSLOGOPTS="netconsole=$LOCALPORT@$LOCALADDR/$DEV,$SYSLOGPORT@$SYSLOGADDR/$SYSLOGMACADDR "