summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/ldadp-launcher8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/ldadp-launcher b/scripts/ldadp-launcher
index df5dd95..6cd0c3f 100755
--- a/scripts/ldadp-launcher
+++ b/scripts/ldadp-launcher
@@ -45,8 +45,14 @@ launch () {
local LOGFILE="/var/log/ldadp/${1}.log"
if [ ! -w "/var/log/ldadp" ] || [ -e "$LOGFILE" -a ! -w "$LOGFILE" ]; then
LOGFILE="/dev/null"
+ elif [ -s "$LOGFILE" ]; then
+ TFILE=$(mktemp)
+ tail -n 50 "$LOGFILE" > "$TFILE"
+ echo "----- Starting $(date) -------" >> "$TFILE"
+ cat "$TFILE" > "$LOGFILE" # Use cat to preserve permissions of $LOGFILE
+ rm -f -- "$TFILE"
fi
- "${BASE}/ldadp" -n "$CONFIG" > "$LOGFILE" &
+ "${BASE}/ldadp" -n "$CONFIG" >> "$LOGFILE" 2>&1 &
local P=$!
sleep 1
if ! kill -0 "$P" 2>/dev/null; then