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

logdog: include /var/log/kdump in the logdog tarball #1695

Merged
merged 2 commits into from
Aug 10, 2021

Conversation

arnaldo2792
Copy link
Contributor

@arnaldo2792 arnaldo2792 commented Aug 4, 2021

Issue number:
N / A

Description of changes:

51cb5257 logdog: include `/var/log/kdump` in the logdog taball

This commit adds /var/log/kdump so that logdog collects crash kernel dumps when they exist.

61402201 logdog: change default output directory for tarball

This commit changes the default output directory for the tarball created by logdog, from /tmp to /var/log/support.

Testing done:

In aws-dev, which has kdump support enabled: I verified that the files generated by prairiedog were collected by logdog:

tar --list -f /.bottlerocket/rootfs/var/log/support/bottlerocket-logs.tar.gz | grep var:
bottlerocket-logs/var
bottlerocket-logs/var/log
bottlerocket-logs/var/log/kdump
bottlerocket-logs/var/log/kdump/dmesg.log
bottlerocket-logs/var/log/kdump/vmcore.dump
bottlerocket-logs/var/log/kdump/prairiedog.log

In aws-ecs-1, which doesn't have kdump support enabled, I verified that logdog still works:

tar --list -f /.bottlerocket/rootfs/var/log/support/bottlerocket-logs.tar.gz
bottlerocket-logs/
bottlerocket-logs/logdog.errors
bottlerocket-logs/containerd-config
bottlerocket-logs/containerd-config-host
bottlerocket-logs/df
bottlerocket-logs/df-inodes
bottlerocket-logs/dmesg
bottlerocket-logs/iptables-filter
bottlerocket-logs/iptables-nat
bottlerocket-logs/journalctl-boots
bottlerocket-logs/journalctl.errors
bottlerocket-logs/journalctl.log
bottlerocket-logs/proc-mounts
bottlerocket-logs/settings.json
bottlerocket-logs/signpost
bottlerocket-logs/wicked
bottlerocket-logs/os-release
bottlerocket-logs/docker-info
bottlerocket-logs/docker-daemon.json
bottlerocket-logs/ecs-config.json
bottlerocket-logs/ecs-tasks

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Copy link
Contributor

@webern webern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

sources/logdog/conf/logdog.common.conf Outdated Show resolved Hide resolved
@bcressey
Copy link
Contributor

bcressey commented Aug 5, 2021

This is an existing problem but the kdump use case exacerbates it - we write the archive to /tmp which is a memory-backed tmpfs.

It'd be better to write it somewhere under /var, preferably in a directory labeled secret_t.

@arnaldo2792 arnaldo2792 force-pushed the log-dog-kdump branch 2 times, most recently from bd6dfb0 to 51cb525 Compare August 6, 2021 23:59
@arnaldo2792
Copy link
Contributor Author

Forced pushes include:

  • Move logdog's output from tmp to /var/log/support with proper permissions
  • Fix documentation to reflect the change
  • Sorry for the spam, I forgot the Sign Off line, and had to amend the commits

@bcressey bcressey changed the title logdog: include /var/log/kdump in the logdog taball logdog: include /var/log/kdump in the logdog tarball Aug 7, 2021
@webern
Copy link
Contributor

webern commented Aug 10, 2021

This is an existing problem but the kdump use case exacerbates it - we write the archive to /tmp which is a memory-backed tmpfs.

It'd be better to write it somewhere under /var, preferably in a directory labeled secret_t.

It's still accessible from 'outside' sudo sheltie under /.bottlerocket? Just trying to make sure I can still use SSH to get the tarball from my local machine via admin container.

@arnaldo2792
Copy link
Contributor Author

It's still accessible from 'outside' sudo sheltie under /.bottlerocket? Just trying to make sure I can still use SSH to get the tarball from my local machine via admin container.

Yes:

agarrcia@ ~> ssh ec2-user@HOST "cat /.bottlerocket/rootfs/var/log/support/bottlerocket-logs.tar.gz" > bottlerocket-logs.tar.gz
agarrcia@ ~> file bottlerocket-logs.tar.gz
bottlerocket-logs.tar.gz: gzip compressed data, original size modulo 2^32 224256

Copy link
Contributor

@webern webern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

nit: one of the commit messages has a spelling error taball.

This commit changes the default output directory for the tarball created
by logdog, from  `/tmp` to `/var/log/support`.

Signed-off-by: Arnaldo Garcia Rincon <[email protected]>
This commit adds `/var/log/kdump` so that logdog collects crash kernel
dumps when they exist.

Signed-off-by: Arnaldo Garcia Rincon <[email protected]>
@arnaldo2792
Copy link
Contributor Author

Forced push fixes commits' messages

@arnaldo2792 arnaldo2792 merged commit 7806833 into bottlerocket-os:develop Aug 10, 2021
@arnaldo2792 arnaldo2792 deleted the log-dog-kdump branch December 6, 2021 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants