Skip to content

daemon truncates its own log on every start, erasing the previous daemon's output #991

Open

Description

@yookibooki

open(LOG, 'w').close() in __main__ truncates the log on every daemon start. When ensure_daemon() respawns a daemon, the previous daemon's last output (WS close code, fatal error) is destroyed before it can be read.

Observed on 0.1.13 (Linux, native Brave, toggle flow): a daemon served fine; a later call found it replaced; the log contained only the new daemon's history — the previous exit was undiagnosable.

Fix is one line: rotate (os.replace(LOG, LOG + '.1')) or append. Related: #920, #865, #784.

Activity

  1. changed the title [-]daemon truncates its own runtime log on every start (open(LOG, 'w')) — previous daemon's death evidence is erased[/-] [+]daemon truncates its own log on every start, erasing the previous daemon's output[/+] on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions