What's new

[BUG] RT-AX86U 386.4 : current syslog lost when router is rebooted

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

ColinTaylor

Part of the Furniture
This was previously discussed in the 386.4 beta thread, for example here. Since then I've revisited this problem and think I have a better understanding of it now.

When the logger is first started it attempts to copy the previous copies of syslog.log and syslog.log-1 from /jffs to /tmp. It appears that neither of these files are being copied and therefore syslogd creates a new syslog.log file in /tmp. watchdog subsequently copies this file from /tmp back to /jffs, effectively overwriting the pre-boot file.

As syslog.log-1 does not exist in /tmp the pre-boot version is still intact in /jffs for now. However, the GUI System Log is looking at files in /tmp so it doesn't display the contents of this old file. Restarting logger causes syslog.log to be copied to /jffs (like watchdog does) and then copies syslog.log and syslog.log-1 from /jffs to /tmp. This causes the contents of syslog.log-1 to reappear in the GUI.

So the question is, what has changed that causes the old files to not be copied to /tmp on startup? I believe it's because of this change. The following lines were added to init.c:

Code:
#if defined(RTAX86U) || defined(RTAX68U)
        start_logger();
#endif
Those new lines appear immediately before this:
Code:
        sysinit();

I suspect that when the logger is started this early /jffs has not been mounted. I believe /jffs is mounted in the following sysinit() procedure.

So the question now is why have Asus done this? Why is there specific code added just for the RT-AX86U and RT-AX68U that effects the logger? Is the solution simply a case of moving those new lines to after the sysinit()?

@RMerlin : Any thoughts?


P.S. The following new code was also added. It's obviously connected in some way that I don't understand.

Code:
        case SIGUSR2:        /* START */
#if !defined(RTAX86U) && !defined(RTAX68U)
            stop_logger();
            start_logger();
#endif
 
Last edited:
No idea why Asus implemented this change. At the very least it needs to be done after the various sysinit() stuff and the JFFS partition gets mounted.

I'll try reverting the whole change, we'll see if anything else breaks down.
 

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top