2022-11-24 19:01:40 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Enable SSH keepalive
|
|
|
|
sed -i -e 's/^[\s#]*TCPKeepAlive\s.*/TCPKeepAlive yes/' -e 's/^[\s#]*ClientAliveInterval\s.*/ClientAliveInterval 60/' /etc/ssh/sshd_config
|
|
|
|
echo 'enabled SSH keep alives'
|
|
|
|
|
2022-12-03 17:04:13 +00:00
|
|
|
# openRC
|
2022-11-24 19:01:40 +00:00
|
|
|
sed -i -e 's/^[\s#]*rc_cgroup_mode=.*/rc_cgroup_mode="unified"/' /etc/rc.conf
|
2022-12-03 17:04:13 +00:00
|
|
|
sed -i -e 's/^[\s#]*rc_logger=.*/rc_logger="YES"/' /etc/rc.conf
|
|
|
|
echo 'enabled cgroupv2, openRC logging'
|
|
|
|
|
|
|
|
# OpenRC parallel - causes too much chaos
|
|
|
|
#sed -i -e 's/^[\s#]*rc_parallel=.*/rc_parallel="YES"/' /etc/rc.conf
|
|
|
|
#echo 'enable parallel openRC'
|
2022-11-24 19:01:40 +00:00
|
|
|
|
2023-04-26 17:22:52 +00:00
|
|
|
# Setup syslog-ng json logging and apparmor tweaks
|
2022-11-24 19:01:40 +00:00
|
|
|
cp /lib/zdt/syslog-ng.conf /etc/syslog-ng/syslog-ng.conf
|
|
|
|
cp /lib/zdt/syslog-ng.logrotate.conf /etc/logrotate.d/syslog-ng
|
2023-04-26 17:22:52 +00:00
|
|
|
cp /lib/zdt/syslog-ng.apparmor /etc/apparmor.d/local/sbin.syslog-ng
|
2022-11-24 19:01:40 +00:00
|
|
|
|
|
|
|
mv /etc/periodic/daily/logrotate /etc/periodic/hourly/
|
|
|
|
echo 'syslog-ng: all to /var/log/messages as json, rotate hourly'
|
|
|
|
|
|
|
|
# use init to spawn monit
|
|
|
|
echo ":2345:respawn:/usr/bin/monit -Ic /etc/monitrc.zdt" >> /etc/inittab
|
|
|
|
echo 'Enable monit via inittab'
|
|
|
|
|
|
|
|
# QoL
|
|
|
|
mv /etc/profile.d/color_prompt.sh.disabled /etc/profile.d/color_prompt.sh || true
|
|
|
|
echo 'alias rs="doas bash"' > /etc/profile.d/alias.sh
|
|
|
|
|