mirror of
https://github.com/bigbeartechworld/big-bear-scripts.git
synced 2026-08-04 19:15:12 -04:00
Add logging
This commit is contained in:
@@ -75,6 +75,30 @@ echo " access-control: ::1 allow_snoop # Allow IPv6 localhost to snoop" | su
|
||||
echo " access-control: 127.0.0.0/8 allow # Allow entire localhost subnet" | sudo tee -a /etc/unbound/unbound.conf.d/main.conf
|
||||
echo " access-control: $SUBNET/24 allow # Allow current local subnet" | sudo tee -a /etc/unbound/unbound.conf.d/main.conf
|
||||
|
||||
# Logging configurations
|
||||
cat <<EOF | sudo tee /etc/rsyslog.d/unbound.conf
|
||||
# Log messages generated by the unbound application
|
||||
if $programname == 'unbound' then /var/log/unbound.log
|
||||
# Stop processing it further
|
||||
& stop
|
||||
EOF
|
||||
|
||||
# Configuration for log rotation
|
||||
cat <<EOF | sudo tee /etc/logrotate.d/unbound
|
||||
/var/log/unbound.log {
|
||||
daily
|
||||
rotate 7
|
||||
missingok
|
||||
create 0640 root adm
|
||||
postrotate
|
||||
/usr/lib/rsyslog/rsyslog-rotate
|
||||
endscript
|
||||
}
|
||||
EOF
|
||||
|
||||
# Restart the rsyslog and logrotate services to apply changes
|
||||
sudo systemctl restart rsyslog logrotate
|
||||
|
||||
# echo -e "\n${GREEN}Updating the sysctl configuration...${NC}"
|
||||
# echo "net.core.rmem_max=8388608" | sudo tee -a /etc/sysctl.conf
|
||||
|
||||
|
||||
Reference in New Issue
Block a user