File tree 3 files changed +8
-12
lines changed
3 files changed +8
-12
lines changed Original file line number Diff line number Diff line change 1
- #! /bin/bash
1
+ #! /bin/sh
2
2
# Mount kernel debug fs so debug tools can work.
3
3
# memdebug=4 and memdebug=5 requires debug fs to be mounted.
4
4
# And there is no need to umount it.
@@ -20,8 +20,6 @@ is_debugfs_ready() {
20
20
}
21
21
22
22
prepare_debugfs () {
23
- local trace_base
24
-
25
23
trace_base=$( get_trace_base)
26
24
# old debugfs interface case.
27
25
if ! [ -d " $trace_base /tracing" ]; then
44
42
if [ -n " $DEBUG_MEM_LEVEL " ]; then
45
43
if [ " $DEBUG_MEM_LEVEL " -ge 5 ]; then
46
44
echo " memstrack - will report kernel module memory usage summary and top allocation stack"
47
- memstrack --report module_summary,module_top --notui --throttle 80 -o /.memstrack &
45
+ nohup memstrack --report module_summary,module_top --notui --throttle 80 -o /.memstrack > /dev/null &
48
46
elif [ " $DEBUG_MEM_LEVEL " -ge 4 ]; then
49
47
echo " memstrack - will report memory usage summary"
50
- memstrack --report module_summary --notui --throttle 80 -o /.memstrack &
48
+ nohup memstrack --report module_summary --notui --throttle 80 -o /.memstrack > /dev/null &
51
49
else
52
50
exit 0
53
51
fi
@@ -61,9 +59,7 @@ if [ $RET -ne 0 ]; then
61
59
exit $RET
62
60
fi
63
61
62
+ echo $PID > /run/memstrack.pid
63
+
64
64
# Wait a second for memstrack to setup everything, avoid missing any event
65
65
sleep 1
66
-
67
- echo $PID > /run/memstrack.pid
68
- # bash specific - non posix
69
- disown
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ ConditionKernelCommandLine=|rd.memdebug=4
7
7
ConditionKernelCommandLine =|rd.memdebug =5
8
8
9
9
[Service]
10
- Type =simple
10
+ Type =forking
11
11
ExecStart =/bin/memstrack-start
12
12
PIDFile =/run/memstrack.pid
13
13
StandardInput =null
Original file line number Diff line number Diff line change @@ -11,12 +11,12 @@ check() {
11
11
}
12
12
13
13
depends () {
14
- echo systemd bash
14
+ echo systemd
15
15
return 0
16
16
}
17
17
18
18
install () {
19
- inst_multiple pgrep pkill
19
+ inst_multiple pgrep pkill nohup
20
20
inst " /bin/memstrack" " /bin/memstrack"
21
21
22
22
inst " $moddir /memstrack-start.sh" " /bin/memstrack-start"
You can’t perform that action at this time.
0 commit comments