Solution
NI Linux Real-Time systems store logs in volatile memory by default, which causes them to be cleared during a reboot. To retain logs and diagnose unexpected restarts, enable persistent logging and collect logs from relevant directories.
-
Check whether logs are stored in volatile memory:
- Run the following command:
ls -ld /var/log
- Verify whether
/var/log points to:
/var/volatile/log
If it does, logs are stored in RAM and will not persist after reboot.
-
Check the NI Linux Real-Time version:
- Run the following command:
cat /etc/os-release
-
Enable persistent logging:
- For NI Linux RT 9.1 or later, run:
nirtcfg --set section=SystemSettings,token=PersistentLogs.enabled,value="True"
- If using NI Linux RT 9.1 specifically, also run:
/etc/init.d/ni-configpersistentlogs
Note: Starting with NI Linux RT 11.2, persistent logging is enabled by default.
-
Restart the system to apply the configuration changes.
-
Collect logs after the next unexpected reboot:
-
Retrieve logs from the following directories:
/var/log/
/var/local/natinst/log/
/var/lib/pstore/
-
Use /var/lib/pstore/ to review kernel logs from previous system crashes.