-
Notifications
You must be signed in to change notification settings - Fork 10
/
kerneloops.init
executable file
·88 lines (75 loc) · 1.57 KB
/
kerneloops.init
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
#!/bin/bash
#
# kerneloops
#
# chkconfig: 345 90 88
# description: A tool that collects and submits kernel crash \
# signatures to the kerneloops.org website for use by the Linux \
# kernel developers.
# processname: kerneloops
# config: /etc/kerneloops.conf
#
### BEGIN INIT INFO
# Provides: kerneloops
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Required-Start: $local_fs $remote_fs $named $network $time $syslog
# Required-Stop: $local_fs $remote_fs $syslog
# Short-Description: Tool to automatically collect and submit kernel crash signatures
# Description: A tool that collects and submits kernel crash
# signatures to the kerneloops.org website for use by the Linux
# kernel developers.
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
exec="/usr/sbin/kerneloops"
prog=$(basename $exec)
sconf="/etc/kerneloops.conf"
lockfile=/var/lock/subsys/$prog
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
start() {
echo -n $"Starting $prog:"
daemon $prog $OPTS
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
fdr_status() {
status $prog
}
case "$1" in
start|stop|restart|reload)
$1
;;
force-reload)
force_reload
;;
status)
fdr_status
;;
condrestart|try-restart)
[ -f $lockfile ] || restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
exit 1
esac