Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicated agent logs and not cleaning up correctly #3201

Open
mudler opened this issue Feb 17, 2025 · 3 comments
Open

Duplicated agent logs and not cleaning up correctly #3201

mudler opened this issue Feb 17, 2025 · 3 comments
Labels
bug Something isn't working triage Add this label to issues that should be triaged and prioretized in the next planning call unconfirmed

Comments

@mudler
Copy link
Member

mudler commented Feb 17, 2025

Kairos version:
3.3.1, but also olders

CPU architecture, OS, and Version:

Describe the bug
Seems we are logging both to /var/log/kairos and /run/kairos. The problem is that while /var/log/kairos logs are rotated, /run isn't rotated and supposedly populated only with sentinel or env config file. Additionally, our current policy seems to be very relaxed and keeps too many files around. The default logrotate policy has rotate till 3 instead of delete using maxage. This is an host almost 2mo old:

Image

To Reproduce
Boot a kairos system

Expected behavior
To have logs in /run/kairos only if /var/log/kairos is not available or immutable

Logs

root@edge-d01b3842ae8bd3e4138e6cc9273671c2:/var/log# cat /run/kairos/agent-20250217103734.1535.log 
2025-02-17T10:37:34Z INF Kairos Agent version=v2.13.9
2025-02-17T10:37:34Z INF Kairos System version=v3.1.3
2025-02-17T10:37:34Z INF creating a runtime
2025-02-17T10:37:34Z INF detecting boot state
2025-02-17T10:37:34Z INF Boot Mode boot_mode=active_boot
2025-02-17T10:37:34Z INF Boot in uki mode result=false
root@edge-d01b3842ae8bd3e4138e6cc9273671c2:/var/log# cat /run/kairos/agent-20250217124237.3715.log
2025-02-17T12:42:37Z INF Kairos Agent version=v2.13.9
2025-02-17T12:42:37Z INF Kairos System version=v3.1.3
2025-02-17T12:42:37Z INF creating a runtime
2025-02-17T12:42:37Z INF detecting boot state
2025-02-17T12:42:37Z INF Boot Mode boot_mode=active_boot
2025-02-17T12:42:37Z INF Boot in uki mode result=false
2025-02-17T12:42:37Z INF Running stage: reconcile.before

2025-02-17T12:42:37Z INF Done executing stage 'reconcile.before'

2025-02-17T12:42:37Z INF Running stage: reconcile

2025-02-17T12:42:37Z INF Done executing stage 'reconcile'

2025-02-17T12:42:37Z INF Running stage: reconcile.after

2025-02-17T12:42:37Z INF Done executing stage 'reconcile.after'

2025-02-17T12:42:37Z INF Running stage: reconcile.before

2025-02-17T12:42:37Z INF Done executing stage 'reconcile.before'

2025-02-17T12:42:37Z INF Running stage: reconcile

2025-02-17T12:42:37Z INF Done executing stage 'reconcile'

2025-02-17T12:42:37Z INF Running stage: reconcile.after

2025-02-17T12:42:37Z INF Done executing stage 'reconcile.after'

Additional context

@mudler mudler added bug Something isn't working triage Add this label to issues that should be triaged and prioretized in the next planning call unconfirmed labels Feb 17, 2025
@mudler mudler changed the title Duplicated agent logs Duplicated agent logs and not cleaning up correctly Feb 18, 2025
@mudler
Copy link
Member Author

mudler commented Feb 19, 2025

See also related issue: #3207

@jimmykarily
Copy link
Contributor

Fixed here: kairos-io/kairos-sdk#566

@Itxaka
Copy link
Member

Itxaka commented Feb 24, 2025

will now log to /var/log/kairos to a single file, appending, thread safe.

If journald is available it will do to jorunal instead.

If logging to file, it will prepend the PID to the log line so its easier to track

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Add this label to issues that should be triaged and prioretized in the next planning call unconfirmed
Projects
Status: No status
Development

No branches or pull requests

3 participants