bin sh netconsole Launches netconsole service chkconfig 11 89 descript

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/bin/sh
#
# netconsole Launches netconsole service.
#
# chkconfig: - 11 89
# description: System administrator can use netconsole service to enable \
# kernel messages logging to remote syslog-ng daemon.
# processname: -
# config: /etc/sysconfig/netconsole
# pidfile: -
# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1
# Source function library.
. /etc/init.d/functions
[ -f /etc/sysconfig/netconsole ] || exit 1
. /etc/sysconfig/netconsole
RETVAL=0
start()
{
msg_starting "netconsole"
echo "7 4 1 7" > /proc/sys/kernel/printk
/sbin/modprobe netconsole netconsole=$SRCPORT@$SRCIP/$DEV,$TGTPORT@$TGTIP/
RETVAL=$?
if [ $RETVAL = 0 ]; then
success "netconsole startup"
else
failure "netconsole startup"
fi
echo
return $RETVAL
}
stop()
{
return 0
}
restart()
{
stop
start
}
reload()
{
restart
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
restart)
restart
;;
condstop)
stop
;;
condrestart)
restart
;;
condreload)
reload
;;
status)
grep -q ^netconsole /proc/modules
if [ $? -eq 0 ]; then
echo "netconsole is running"
RETVAL=0
exit $RETVAL
fi
echo "netconsole is stopped"
RETVAL=3
;;
*)
msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
RETVAL=1
esac
exit $RETVAL
here goes /etc/sysconfig/netconsole
SRCIP=127.0.0.1
DEV=eth0
SRCPORT=54321
TGTIP=127.0.0.1
TGTPORT=554