summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2017-01-17 14:26:28 +0100
committerSimon Rettberg2017-01-17 14:26:28 +0100
commit94683eeb9948ea7a89d3f05669fa8bf95c25450d (patch)
treeb792ea7f3dafab511f8dd9bfbfdc5a9abe752433
parent[RecompressArchive] Handle exception when adding file to archive (diff)
downloadtmlite-bwlp-94683eeb9948ea7a89d3f05669fa8bf95c25450d.tar.gz
tmlite-bwlp-94683eeb9948ea7a89d3f05669fa8bf95c25450d.tar.xz
tmlite-bwlp-94683eeb9948ea7a89d3f05669fa8bf95c25450d.zip
[CreateLdapConfig] Append to ldadp logfile instead of replacing it on (re)start
-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