mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
misc: rotate crash.log for kobo/kindle/pocketbook
This commit is contained in:
@@ -243,7 +243,11 @@ logmsg "Starting KOReader . . ."
|
||||
if [ "${FROM_KUAL}" == "yes" ] ; then
|
||||
eips_print_bottom_centered "Starting KOReader . . ." 1
|
||||
fi
|
||||
./reader.lua "$@" > crash.log 2>&1
|
||||
|
||||
# we keep maximum 100K worth of crash log
|
||||
cat crash.log &> /dev/null | tail -c 100000000 > crash.log.new
|
||||
mv -f crash.log.new crash.log
|
||||
./reader.lua "$@" >> crash.log 2>&1
|
||||
|
||||
# clean up our own process tree in case the reader crashed (if needed, to avoid flooding KUAL's log)
|
||||
if pidof reader.lua > /dev/null 2>&1 ; then
|
||||
|
||||
@@ -111,7 +111,10 @@ if awk '$4~/(^|,)ro($|,)/' /proc/mounts | grep ' /mnt/sd ' ; then
|
||||
mount -o remount,rw /mnt/sd
|
||||
fi
|
||||
|
||||
./reader.lua "${args}" > crash.log 2>&1
|
||||
# we keep maximum 100K worth of crash log
|
||||
cat crash.log &> /dev/null | tail -c 100000000 > crash.log.new
|
||||
mv -f crash.log.new crash.log
|
||||
./reader.lua "${args}" >> crash.log 2>&1
|
||||
|
||||
if [ "${FROM_NICKEL}" = "true" ] ; then
|
||||
if [ "${FROM_KFMON}" != "true" ] ; then
|
||||
|
||||
@@ -33,7 +33,10 @@ else
|
||||
args="$@"
|
||||
fi
|
||||
|
||||
./reader.lua "$args" > crash.log 2>&1
|
||||
# we keep maximum 100K worth of crash log
|
||||
cat crash.log &> /dev/null | tail -c 100000000 > crash.log.new
|
||||
mv -f crash.log.new crash.log
|
||||
./reader.lua "$args" >> crash.log 2>&1
|
||||
|
||||
if pidof reader.lua > /dev/null 2>&1 ; then
|
||||
killall -TERM reader.lua
|
||||
|
||||
12
reader.lua
12
reader.lua
@@ -1,4 +1,16 @@
|
||||
#!./luajit
|
||||
print(string.format([[
|
||||
---------------------------------------------
|
||||
launching...
|
||||
_ _____ ____ _
|
||||
| |/ / _ \| _ \ ___ __ _ __| | ___ _ __
|
||||
| ' / | | | |_) / _ \/ _` |/ _` |/ _ \ '__|
|
||||
| . \ |_| | _ < __/ (_| | (_| | __/ |
|
||||
|_|\_\___/|_| \_\___|\__,_|\__,_|\___|_|
|
||||
|
||||
[*] Current time: %s
|
||||
]], os.date("%x-%X")))
|
||||
|
||||
|
||||
-- load default settings
|
||||
require "defaults"
|
||||
|
||||
Reference in New Issue
Block a user