Tiny Core Base > TCB Talk

Re: Tiny Core v17.0 upgrade issues

<< < (3/13) > >>

Stefann:

--- Quote from: Rich on March 18, 2026, 03:34:32 PM ---Hi Stefann

--- Quote from: Stefann on March 18, 2026, 02:41:02 PM --- ... any tips on how I can put logging in place?
- problem is that everything runs in ram. So I have zero diagnostics in case of a crash. ...
--- End quote ---
Yes, but your extensions are on persistent storage, right?
So send any log messages to  /etc/sysconfig/tcedir/SomeFileName.log


--- End quote ---
True… but “what should I log”?
My application does log but just progress things


--- Quote from: Leee on March 18, 2026, 03:42:01 PM ---With everything running in RAM and you backups suddenly getting bigger, maybe you're running out of memory?  Does the test system have more memory than the live system?

--- End quote ---
No, backups are not suddenly bigger.
When going to tc17 I made copy of tce/optional folder. That occupies about 280M diskspace. But still 3G available.

Stefann:
Oh by the way @rich…
I’m normally logging to ramdisk.
I normally do 1 single status diskwrite per day
For reason I have flash disk. I want to keep that healthy.
A bit extra temporal disk logging is ok.
But I don’t want mass logging on flash

Stefann:
For those interested, output of “top”.
I don’t see anything suspicious.
My home automation application is: /krubo/work/krubo /krubo/work/1wire.def

Anyway…
It’s late now, I restarted the application and have a sleep.
Tomorrow I will undo the apps update but keep the tc17 core.gz and vmlinuz.
I will also start the application on my test system without pheripherals
Than run that for few days to see whether it holds.

If it fails I will go back to tc15 to see whether it still runs on tc15.
It has been running for multiple month on tc15 without a glitch but all the activity in upgrading may have degraded some old hardware (maybe the flash card isn’t healthy anymore?)
If tc15 works and tc17 does not, I will test tc16.


--- Code: ---
Mem: 410040K used, 551480K free, 34800K shrd, 4412K buff, 204960K cached
CPU:  5.4% usr  6.4% sys  0.0% nic 88.1% idle  0.0% io  0.0% irq  0.0% sirq
Load average: 0.31 0.23 0.16 2/197 4900
  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
 4130     1 tc       S    11572  1.2   0 10.6 /krubo/work/krubo /krubo/work/1wire.def
 3481     1 root     S    54508  5.6   0  0.3 /usr/local/sbin/rsyslogd
 4880  4849 tc       R     3600  0.3   0  0.3 top
 4014     1 root     S     8192  0.8   0  0.2 x0vncserver -PasswordFile=/home/tc/.vnc/passwd
 4848  4844 tc       S     7968  0.8   0  0.2 sshd-session: tc@pts/0
 4017  3993 tc       S     442m 47.0   0  0.0 /usr/local/sbin/httpd -k start
 4019  3993 tc       S     395m 41.9   0  0.0 /usr/local/sbin/httpd -k start
 4050  3993 tc       S     391m 41.6   0  0.0 /usr/local/sbin/httpd -k start
 4314  3993 tc       S     382m 40.6   0  0.0 /usr/local/sbin/httpd -k start
 3993     1 root     S     162m 17.2   0  0.0 /usr/local/sbin/httpd -k start
 3995     1 root     S    44968  4.6   0  0.0 Xvesa -br -screen 1024x768x32 -shadow -2button -mouse /dev/i
 3821  3798 root     S    18868  1.9   0  0.0 /usr/local/sbin/smbd -D
 3798     1 root     S    18812  1.9   0  0.0 /usr/local/sbin/smbd -D
 4120     1 tc       S     9852  1.0   0  0.0 wbar
 4003     1 tc       S     9628  1.0   0  0.0 flwm
 4844  3855 root     S     7564  0.7   0  0.0 sshd-session: tc [priv]
 3855     1 root     S     7312  0.7   0  0.0 sshd: /usr/local/sbin/sshd [listener] 0 of 10-100 startups
 3641     1 root     S     6056  0.6   0  0.0 /usr/local/sbin/nmbd -D

--- End code ---

Rich:
Hi Stefann

--- Quote from: Stefann on March 18, 2026, 03:59:56 PM --- ... True… but “what should I log”? ...
--- End quote ---

Well, I would start with syslog to capture any system errors. If you included
the syslog boot code in your boot loaders config file, remove it.
Add this to /opt/bootlocal.sh:

--- Code: ---/sbin/syslogd -O /etc/sysconfig/tcedir/messages -s 1000 -b 5 -l 5
--- End code ---
-O The log files will be messages, messages.0, ..., messages.4.
-s Each file will be limited to 1000K (1 Mbyte) before rotating to the next log file.
-b There will be 5 rotated logs kept for a total of 6Mbytes.
-l Log only messages of Warning or above.
These are the syslog message levels:

--- Code: ---Level Severity Description Example Use Case
0 Emergency System is unusable Hardware failure causing a full system crash
1 Alert Immediate action required Database corruption detected
2 Critical Critical conditions Firewall dropping all traffic unexpectedly
3 Error Error conditions Authentication failures
4 Warning Potential issues High CPU or memory usage
5 Notice Normal but significant events Configuration changes applied
6 Informational General system activity User logins, completed backups
7 Debug Debugging information Function traces, variable dumps
--- End code ---

You could also run free once every 5 minutes to keep a log of memory and swap usage.
Create a file called FreeMem.sh under .local/bin in your home directory and make it
executable (chmod 755 .local/bin/FreeMem.sh).
Place the following in that file:

--- Code: ---#!/bin/sh

Dest="/etc/sysconfig/tcedir/FreeMem.log"

while true
do
echo -ne "$(date)\n$(free -m)\n\n" >> "$Dest"
# Limit log file to last 2400 lines (400 entries) if it is greater or equal to 2460 lines (410 entries).
[ $(wc -l "$Dest" | cut -d " " -f1) -ge 2460 ] && echo "$(tail -n 2400 $Dest)" > "$Dest"
sleep 300
done
--- End code ---
The log file will hold about 33 hours worth of entries and be about 100 Kbytes in size.

To launch it, enter this into /opt/bootlocal.sh:

--- Code: ---/home/tc/.local/bin/FreeMem.sh &
--- End code ---
This assumes you are running as user tc. Change tc to your user name if required.

    [Edit]: Changed  messages.1, ..., messages.5  to  messages.0, ..., messages.4.  Rich

Stefann:
Thanks for the suggestions. It helps.
It’s now 7am here in the Netherlands.
When I got up the system had crashed again. After about 8 hours.
Everything halted. Apache server not reachable, ssh not reachable.
So..
- Either the system is completely crashed
- Or the network has crashed
Some “non network peripherals” are also dead which indicates that the application is frozen. As far as I have tested earlier the application keeps running if network drops so I guess most changes are that system has completely crashed.

So.. it’s a bit chilly here now because the heatpump has not been operational this night.

Although the whole thing  could be hardware related as the TC upgrade process required me to do a lot more disk actions that this system normally does, my big suspecting is that it is TC17 related (or TC16 as it was running TC15).
That I expect makes it a valid entry for this thread (if I’m polluting something feel free to correct me on that).

What I will do:
- run the thing on TC17 core.gz and vmlinuz but with all TC15 applications (.tcz files).
- include syslog logging as suggested by @rich. Thanks for that! I’m normally using rsyslog and use the logging for application logging. I will however revert to the original syslog and use the commands as you suggested. I will plug-in an external usb and write to that. By doing so I will avoid write-stress on my compact flashdrive. I will pause all application logging for a while. That’s no big deal, I only need that for application development and that’s on halt now anyway.
- in addition start running the application without peripherals on my “test system” on TC17. I will also run the python and php “helper programs” on that. Those helper programs grab data from internet api’s (get weather info, get energy prices, read my car status). As this interaction is in a “less controlled environment” it could be that the issue is in those. It’s still very very very strange that any application failure can completely crash the OS.
- find and connect my old monitor and keyboard somewhere in the mess at the attic. I kept these for especially this reason (Hope I can find them). If the OS is not crashed but only the network that should allow me to operate the system after crash.

Guess that should bring me somewhere.
Again especially thanks @rich.
I had to think on “how to log without wearing out my compact flashdrive” but your suggestion is very key to “not being blind”.

Any additional suggestions are welcome.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version