forked from SUSE/s390-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vmlogrdr
98 lines (86 loc) · 1.88 KB
/
vmlogrdr
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
#!/bin/sh
# Copyright (c) 2003 SUSE LINUX AG Nuernberg, Germany.
#
# Submit feedback to http://www.suse.de/feedback/
#
# /etc/init.d/vmlogrdr
#
# and symbolic its link
#
# /use/sbin/rcvmlogrdr
#
#
### BEGIN INIT INFO
# Provides: vmlogrdr
# Required-Start: $network $remote_fs
# Required-Stop: $null
# Default-Start: 3 5
# Default-Stop: 0 1 6
# Short-Description: Linux - z/VM Log reader
# Description: System startup script for the Linux - z/VM Log reader
### END INIT INFO
#
# Local settings
SERVICE=LOGREC
DEVNODE=/dev/vmlogrdr_${SERVICE}
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v ditto but be verbose in local rc status
# rc_status -v -r ditto and clear the local rc status
# rc_failed set local and overall rc status to failed
# rc_failed <num> set local and overall rc status to <num><num>
# rc_reset clear local rc status (overall remains)
# rc_exit exit appropriate to overall rc status
. /etc/rc.status
# First reset status of this service
rc_reset
RETVAL=0
start() {
echo -n "Starting z/VM log reader for service $SERVICE... "
if [ -e $DEVNODE ]; then
echo -n "(already running)"
rc_status -v
rc_exit
fi
modprobe vmlogrdr 2>&1
if [ "$?" -ne 0 ] ; then
rc_failed 1
fi
rc_status -v
}
stop() {
echo "Stopping z/VM log reader for service $SERVICE... "
rmmod vmlogrdr
rc_status -v
}
restart() {
stop
start
}
status() {
echo -n "Checking z/VM log reader for service $SERVICE... "
if [ ! -e $DEVNODE ]; then
rc_failed 1
fi
rc_status -v
}
# How are we called?
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart|reload)
restart
;;
*)
echo "Usage: vmlogrdr {start|stop|status|restart|reload}"
RETVAL=1
esac
exit $RETVAL