-
Notifications
You must be signed in to change notification settings - Fork 46
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
niconfigpersistentlogs: add init script to configure persistent logs #463
Conversation
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>
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:]") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
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.
recipes-ni/niconfigpersistentlogs/niconfigpersistentlogs_1.0.bb
Outdated
Show resolved
Hide resolved
Signed-off-by: Jeffrey Pautler <jeffrey.pautler@ni.com>
Signed-off-by: Jeffrey Pautler <jeffrey.pautler@ni.com>
There was a problem hiding this 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?
recipes-ni/ni-configpersistentlogs/ni-configpersistentlogs_1.0.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:]") |
There was a problem hiding this comment.
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.
recipes-ni/ni-configpersistentlogs/ni-configpersistentlogs_1.0.bb
Outdated
Show resolved
Hide resolved
…ariable Signed-off-by: Jeffrey Pautler <jeffrey.pautler@ni.com>
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