From 94683eeb9948ea7a89d3f05669fa8bf95c25450d Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 17 Jan 2017 14:26:28 +0100 Subject: [CreateLdapConfig] Append to ldadp logfile instead of replacing it on (re)start --- scripts/ldadp-launcher | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts') 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 -- cgit v1.2.3-55-g7522