-
Notifications
You must be signed in to change notification settings - Fork 47
Logs
All the components are configured so that they put their log files in /var/log
. It is in fact a symbolic link to /data/log
, a directory that is created at first boot. This way, logs are persisted on the only writable partition and are preserved across firmware updates.
The cron daemon runs logrotate every day at 3:14, using the /etc/logrotate.conf
configuration file.
All files in /var/log
having a .log
extension will be compressed and rotated as soon as they reach a size of 10MB. No more than 9 rotated versions will be kept for each log file.
Logs are very useful for identifying what went wrong and that's why, in most cases, we want logs to be persisted (i.e. written to the SD card). However there are applications where we simply don't care that much about logs and we prefer preventing any possible writing to the SD card.
To configure an existing system to write its logs to RAM, you simply need to transform the /data/log
directory into symbolic link pointing to /tmp
, which is a temporary filesystem mounted in RAM:
mv /data/log /data/log.bak
ln -s /tmp /data/log
reboot
After reboot, you can optionally remove the old logs directory:
rm -r /data/log.bak
To build an OS that has its log directory in RAM by default, just edit the postscript.sh
file and change ln -s /data/log $TARGET/var/log
into ln -s /tmp $TARGET/var/log
.
The syslog daemon provided by busybox is automatically started at boot by S05syslog
. It uses the /etc/syslog.conf
configuration file and logs to /var/log/messages
.
The boot log (the output from the init scripts) is written (appended) to /var/log/boot.log
. This is done by the main script that handles the boot process, /etc/init.d/rcS
.
The kernel log (dmesg) is written (appended) to /var/log/dmesg.log
. This is done by the /etc/init.d/S05syslog
init script, using dmesg -w
.
The /var/log/messages
file is the output of the syslog daemon. This can be changed in /etc/syslog.conf
.
- bluetooth.conf
- captive-portal.conf
- cpufreq.conf
- date.conf
- dnsmasq.conf
- docker-compose.yml
- dtoverlays
- dyndns-update.sh
- environment
- firewall.sh
- fstab.user
- hostapd.conf
- ifalias.conf
- localtime
- modprobe.conf
- modules
- mongodb.conf
- netwatch.conf
- ntp.conf
- os.conf
- proftpd.conf
- redis.conf
- smb.conf
- ssh/config
- ssh/sshd_config
- ssl/domain
- ssl/email
- static_ip.conf
- sysctl.conf
- toemmc.conf
- version
- watchdog.conf
- wpa_supplicant.conf