mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-11 16:01:28 +00:00
13 lines
466 B
Bash
13 lines
466 B
Bash
|
|
if [ "$start_old" != "ON" ] && ckcmd journalctl; then
|
|
journalctl -u shellcrash >"$TMPDIR"/core_test.log
|
|
else
|
|
PID=$(pidof CrashCore) && [ -n "$PID" ] && kill -9 "$PID" >/dev/null 2>&1
|
|
${COMMAND} >"$TMPDIR"/core_test.log 2>&1 &
|
|
sleep 2
|
|
kill $! >/dev/null 2>&1
|
|
fi
|
|
error=$(cat $TMPDIR/core_test.log | grep -iEo 'error.*=.*|.*ERROR.*|.*FATAL.*')
|
|
logger "服务启动失败!请查看报错信息!详细信息请查看$TMPDIR/core_test.log" 33
|
|
logger "$error" 31
|