forked from clrkwllms/realtime-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrtapp-example.sh
80 lines (66 loc) · 1.37 KB
/
rtapp-example.sh
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
#!/usr/bin/bash
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# the following is the chkconfig init header
#
# rtapp-example: processor frequency scaling support
#
# chkconfig: 345 99 01
# description: Run realtime application
#
# the following is the LSB init header see
# http://www.linux-foundation.org/spec//booksets/LSB-Core-generic/LSB-Core-generic.html#INITSCRCOMCONV
#
### BEGIN INIT INFO
# Provides: rtapp-example
# Should-Start:
# Default-Start: 3 4 5
# Short-Description: launcher script for realtime application
# Description: This script performs all system manipulations required for
# starting/stopping rtapp-example (i.e. isolating cpus, moving IRQ
# affinities, etc). and then starts or stops the rt applications
# using the tuna command line tool
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
prog="rtapp-example"
prep() {
# do core isolation and IRQ affinity mainipulations here
}
rollback() {
# undo core isolation and IRQ affinity changes here
}
startapp() {
# start application processes
}
stopapp() {
# stop application processes
}
start() {
prep
startapp
}
stop() {
rollback
stopapp
}
status() {
}
usage() {
echo "$0: start|stop|status|help"
exit 1
}
RETVAL=0
case "$1" in
start)
start
;;
stop)
stop
;;
status)
;;
*)
esac
exit $RETVAL