Community
cancel
Showing results for 
Search instead for 
Did you mean: 
RPres3
Novice
1,822 Views

How to make journalctl save log from previous boot to diagnose a crash?

Recent yocto images have somehow disabled persistent storage of journal files so that you can only look at the log for the current boot. (even though "Storage=persistent" in journald.conf)

They did this to prevent it from overrunning the rootfs partition.

A previous thread suggested creating a service to periodically backup the log to another file, but I think that's an imperfect solution because that file probably won't contain the crucial last few error entries. The system would be crashed at that point.

Does anyone know an easy way to temporarily make it persistent like before, or set it to save only two logs rather than one? I can't figure out how the persistence was disabled.

0 Kudos
4 Replies
idata
Community Manager
100 Views

Hi cobster,

 

 

Currently we are investigating your case. We will get back to you as soon as we have a complete answer about your questions.

 

 

Regards,

 

-Pablo
RPres3
Novice
100 Views

Now I see how it is made volatile. Even though Storage=persistent, and /var/log/journal exists, /var/log has been made into a symbolic link to subdirectory of /var/volatile, which is a tmpfs ramdisk mountpoint.

idata
Community Manager
100 Views

Hi Cobster,

 

 

We truly apologize for the delay in our response. We already have some updates on this case, check our notes below:

 

The edison-image.bbappend file in meta-intel-iot-devkit/recipes-core/images is the place where the volatile log is set up. Specifically the line immediately following the comment "# Add volatile log".

 

You can comment out this line and rebuild the image.

 

If you want to use an existing image, then you should disable volatile logs by doing something like this:

 

1. Comment out the line for /var/volatile/log in /etc/tmpfiles.d/00-create-volatile.conf

 

2. rm /var/log (deletes the existing symlink to /var/volatile/log)

 

3. mkdir /var/log (creates a real directory to replace the symlink just deleted)

 

Then reboot and logs should be persistent.

 

 

Regards,

 

-Pablo
idata
Community Manager
100 Views

Hi Cobster,

 

 

I'm wondering if you have tried our suggestion. Did you have different results?

 

 

Kind regards,

 

-Pablo
Reply