Skip to content

Commit df0a378

Browse files
authored
[script][taier-script] fix start script not check dir (#998)
(cherry picked from commit 707c927) Former-commit-id: eb9fe5565467dbfc080e2ec1f693bd124f145bcd
1 parent 034c81a commit df0a378

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

bin/taier.sh

+16-2
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,28 @@ pidfile="${CMD_HOME}/run/$name.pid"
1818
gc_log=${CMD_HOME}/logs/taier.gc
1919
heapdump=${CMD_HOME}/taier.hprof
2020

21-
touch $gc_log
22-
2321
program=${LS_HOME}/bin/base.sh
2422

2523
quiet() {
2624
"$@" > /dev/null 2>&1
2725
return $?
2826
}
2927

28+
checkDir(){
29+
if [ ! -d "$LS_LOG_DIR" ]; then
30+
mkdir "$LS_LOG_DIR"
31+
32+
fi
33+
34+
if [ ! -d "$CMD_HOME/run" ]; then
35+
mkdir "$CMD_HOME/run"
36+
fi
37+
38+
if [ ! -f "$gc_log" ]; then
39+
touch "$gc_log"
40+
fi
41+
}
42+
3043
start() {
3144
echo -n "Starting $name "
3245

@@ -35,6 +48,7 @@ start() {
3548
export PATH HOME LS_HEAP_SIZE JAVA_OPTS LS_USE_GC_LOGGING LS_GC_LOG_FILE
3649
#ulimit -n ${LS_OPEN_FILES}
3750

51+
checkDir
3852
nice -n ${LS_NICE} sh -c "
3953
cd $LS_HOME
4054
exec \"$program\" $args

0 commit comments

Comments
 (0)