digging deeper with du -sh I see 25G is consumed by /var/log → roughly split into 3x 8G for deamon.log daemon.log.1 and syslog
removed daemon.log.1 → sound restored!
think we need a more aggresive logrotate + less elaborate logging → every 2 seconds a line for the /api poll is triggered by open running clients and added to the log
Aug 23 16:20:11 amplipi authbind[808]: INFO: 10.0.100.181:35554 - "GET /api HTTP/1.1" 200 OK
Aug 23 16:20:13 amplipi authbind[808]: INFO: 10.0.100.181:35554 - "GET /api HTTP/1.1" 200 OK
Aug 23 16:20:15 amplipi authbind[808]: INFO: 10.0.100.181:35554 - "GET /api HTTP/1.1" 200 OK
Aug 23 16:20:17 amplipi authbind[808]: INFO: 10.0.100.181:35554 - "GET /api HTTP/1.1" 200 OK
Aug 23 16:20:19 amplipi authbind[808]: INFO: 10.0.100.181:35554 - "GET /api HTTP/1.1" 200 OK
Sorry about that! This looks like a journalctl configuration issue. By default newer AmpliPis should no longer log to disk. We need to add a check for this in the install script to fix older installs.
Digging in to what is writing to all of these log files a little deeper it looks like reconfiguring journalctl for volatile operation reduced the writing to /var/log/daemon.log but did not eliminate it. Additionally /var/log/syslog was being written by an entirely seperate logging utility called rsyslog.
Since there is no need to double log everything, we can disable the service with:
However this will not delete any of the previous logs. I attempted to use logrotate to clean up some of the bigger log files but this seems more complicated than it is worth.
For simplicity you might as well just delete the daemon and sys logs:
sudo rm /var/log/daemon* /var/log/syslog*
Note: this was edited to clarify some earlier confusion between daemon.log and syslog files
I just noticed /var/log/user.log is very large and filling up very quickly with;
Aug 26 10:06:32 amplipi authbind[806]: Device or resource busy.
Aug 26 10:06:32 amplipi authbind[806]: [0254ae50] main audio output error: module not functional
Aug 26 10:06:32 amplipi authbind[806]: [7050e258] main decoder error: failed to create audio output
Aug 26 10:06:32 amplipi authbind[806]: [0254ae50] alsa audio output error: cannot open ALSA device "ch0": Device or resource busy
Aug 26 10:06:32 amplipi authbind[806]: [0254ae50] main audio output error: Audio output failed
Aug 26 10:06:32 amplipi authbind[806]: [0254ae50] main audio output error: The audio device "ch0" could not be used:
Aug 26 10:06:32 amplipi authbind[806]: Device or resource busy.
Aug 26 10:06:32 amplipi authbind[806]: [0254ae50] main audio output error: module not functional
Aug 26 10:06:32 amplipi authbind[806]: [7050e258] main decoder error: failed to create audio output
Aug 26 10:06:32 amplipi authbind[806]: [0254ae50] alsa audio output error: cannot open ALSA device "ch0": Device or resource busy
Aug 26 10:06:32 amplipi authbind[806]: [0254ae50] main audio output error: Audio output failed
Aug 26 10:06:32 amplipi authbind[806]: [0254ae50] main audio output error: The audio device "ch0" could not be used:
Aug 26 10:06:32 amplipi authbind[806]: Device or resource busy.
Aug 26 10:06:32 amplipi authbind[806]: [0254ae50] main audio output error: module not functional
Aug 26 10:06:32 amplipi authbind[806]: [7050e258] main decoder error: failed to create audio output
Aug 26 10:06:32 amplipi authbind[806]: [0254ae50] alsa audio output error: cannot open ALSA device "ch0": Device or resource busy
Aug 26 10:06:32 amplipi authbind[806]: [0254ae50] main audio output error: Audio output failed
Aug 26 10:06:32 amplipi authbind[806]: [0254ae50] main audio output error: The audio device "ch0" could not be used:
Aug 26 10:06:32 amplipi authbind[806]: Device or resource busy.
Aug 26 10:06:32 amplipi authbind[806]: [0254ae50] main audio output error: module not functional
Aug 26 10:06:32 amplipi authbind[806]: [7050e258] main decoder error: failed to create audio output
Aug 26 10:06:32 amplipi authbind[806]: [0254ae50] alsa audio output error: cannot open ALSA device "ch0": Device or resource busy
Aug 26 10:06:32 amplipi authbind[806]: [0254ae50] main audio output error: Audio output failed
Aug 26 10:06:32 amplipi authbind[806]: [0254ae50] main audio output error: The audio device "ch0" could not be used:
Aug 26 10:06:32 amplipi authbind[806]: Device or resource busy.
Aug 26 10:06:32 amplipi authbind[806]: [0254ae50] main audio output error: module not functional
Aug 26 10:06:32 amplipi authbind[806]: [7050e258] main decoder error: failed to create audio output
I’ve been testing a script that we are planning on adding to the next update. As far as I can tell it stops most of the logging to disk @sumnerboy, happen to want to try it out?
# stop and disable the secondary logging utility rsyslog
sudo systemctl stop rsyslog.service
sudo systemctl disable rsyslog.service
# reconfigure journald to only log to RAM
echo -e "[Journal]\nStorage=volatile\nRuntimeMaxUse=64M\n" | sudo tee /etc/systemd/journald.conf
sudo systemctl restart systemd-journald.service
# delete some old logs
sudo journalctl --rotate
sudo journalctl --vacuum-time=10m
sudo rm /var/log/daemon* /var/log/syslog*
It looks like journald by default forwards messages to rsyslog which was writing the logs to disk even after we told journald not to log to disk. This is why we needed to disabled rsyslog after configuring journald for RAM only logging.
Ran all these commands, but I am still seeing continuous logging to /var/log/user.log and /var/log/messages (see log I posted above about Audio output failed).
A reboot appears to have stopped the continuous logging, so I have cleared out user.log and messages and rebooted again.
I wonder if whatever is causing those audio output failed log events is the root cause of my issues?
Here’s what I think a logfile-less /etc/rsyslog.conf looks like:
# /etc/rsyslog.conf configuration file for rsyslog
#
# For more information install rsyslog-doc and see
# /usr/share/doc/rsyslog-doc/html/configuration/index.html
#################
#### MODULES ####
#################
module(load="imuxsock") # provides support for local system logging
module(load="imklog") # provides kernel logging support
#module(load="immark") # provides --MARK-- message capability
# provides UDP syslog reception
#module(load="imudp")
#input(type="imudp" port="514")
# provides TCP syslog reception
#module(load="imtcp")
#input(type="imtcp" port="514")
###########################
#### GLOBAL DIRECTIVES ####
###########################
#
# Use traditional timestamp format.
# To enable high precision timestamps, comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
#
# Set the default permissions for all log files.
#
$FileOwner root
$FileGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022
#
# Where to place spool and state files
#
$WorkDirectory /var/spool/rsyslog
#
# Include all config files in /etc/rsyslog.d/
#
$IncludeConfig /etc/rsyslog.d/*.conf
###############
#### RULES ####
###############
# Do almost nothing! We probably don't need any of the old rules :)
# Emergencies are sent to everybody logged in.
#
*.emerg :omusrmsg:*
After updating that file, restart rsyslog with the commands below. Does your logging setup work again?
NOTE: we may need to add the flag ForwardToSyslog=yes to /etc/systemd/journald.conf and restart journald (sudo systemctl restart systemd-journald.service) but I think this is enabled by default