Skip to content

Commit

Permalink
start-stop-daemon: truncate log file for stdout.
Browse files Browse the repository at this point in the history
The initial part of that file can be useful if tailscaled
is crashing or has other failures during startup. We don't
want to keep the disk from hibernating by writing to it after
startup.

Fixes tailscale/tailscale#7007

Signed-off-by: Denton Gentry <[email protected]>
  • Loading branch information
DentonGentry committed Jan 20, 2023
1 parent e409f62 commit 0351052
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scripts/start-stop-status
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fi
start_daemon() {
local ts=$(date --iso-8601=second)
echo "${ts} Starting ${SERVICE_NAME} with: ${SERVICE_COMMAND}" >${LOG_FILE}
STATE_DIRECTORY=${PKGVAR} ${SERVICE_COMMAND} >>${LOG_FILE} 2>&1 &
STATE_DIRECTORY=${PKGVAR} ${SERVICE_COMMAND} 2>&1 | sed -u '1,200p;d' >>${LOG_FILE} &
echo "$!" >"${PID_FILE}"
}

Expand Down

0 comments on commit 0351052

Please sign in to comment.