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

niconfigpersistentlogs: add init script to configure persistent logs #463

Conversation

jpautler
Copy link
Contributor

As installed, /var/log is a symlink to /var/volatile/log which is located on a tmpfs mount. As a result, logs are lost on each reboot. This change provides a simple way for users to change logs to be persistent across reboots for debugging purposes and to change back again.

Signed-off-by: Jeffrey Pautler jeffrey.pautler@ni.com

As installed, /var/log is a symlink to /var/volatile/log which is located on a
tmpfs mount. As a result, logs are lost on each reboot. This change provides
a simple way for users to change logs to be persistent across reboots for
debugging purposes and to change back again.

Signed-off-by: Jeffrey Pautler <jeffrey.pautler@ni.com>
recipes-core/packagegroups/packagegroup-ni-runmode.bb Outdated Show resolved Hide resolved
PERSISTENT_DIR_VAR_LOG_LINE="d root root 0755 /var/log none"
VOLATILE_SYMLINK_VAR_LOG_LINE="l root root 0755 /var/log /var/volatile/log"

ENABLE_PERSISTENT_LOGS_INI_VAL=$(/usr/local/natinst/bin/nirtcfg --get section=SystemSettings,token=PersistentLogs.enabled,value="false" | tr "[:upper:]" "[:lower:]")
Copy link
Contributor

Choose a reason for hiding this comment

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

New guidance is to rely on PATH to evaluate your binaries. So $(nirtcfg ...) is preferred.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

Choose a reason for hiding this comment

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

Did you change it? It looks the same to me.

Signed-off-by: Jeffrey Pautler <jeffrey.pautler@ni.com>
Signed-off-by: Jeffrey Pautler <jeffrey.pautler@ni.com>
Copy link
Contributor

@shruthi-ravi shruthi-ravi left a comment

Choose a reason for hiding this comment

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

Can you squash your commits when it is ready to be merged?

@jpautler jpautler requested a review from amstewart September 23, 2022 13:21
PERSISTENT_DIR_VAR_LOG_LINE="d root root 0755 /var/log none"
VOLATILE_SYMLINK_VAR_LOG_LINE="l root root 0755 /var/log /var/volatile/log"

ENABLE_PERSISTENT_LOGS_INI_VAL=$(/usr/local/natinst/bin/nirtcfg --get section=SystemSettings,token=PersistentLogs.enabled,value="false" | tr "[:upper:]" "[:lower:]")
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you change it? It looks the same to me.

…ariable

Signed-off-by: Jeffrey Pautler <jeffrey.pautler@ni.com>
Signed-off-by: Jeffrey Pautler <jeffrey.pautler@ni.com>
@amstewart amstewart merged commit 42b1da1 into ni:nilrt/master/hardknott Sep 23, 2022
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.

5 participants