Skip to content
Snippets Groups Projects
Commit a361727d authored by Bob Mottram's avatar Bob Mottram
Browse files

Clear out keyserver logs more frequently and make sure that sks daemon is stopped when clearing

parent 4398c8b9
No related branches found
No related tags found
No related merge requests found
......@@ -64,6 +64,8 @@ function keyserver_watchdog {
keyserver_mail_subject_line=$"${PROJECT_NAME} keyserver warning"
keyserver_mail_subject_line_disabled=$"${PROJECT_NAME} keyserver disabled"
read_config_param KEYSERVER_DOMAIN_NAME
# check database size hourly
keyserver_watchdog_script=/etc/cron.hourly/keyserver-watchdog
echo '#!/bin/bash' > $keyserver_watchdog_script
echo "dirsize=\$(du /var/lib/sks/DB | awk -F ' ' '{print \$1}')" >> $keyserver_watchdog_script
......@@ -80,6 +82,17 @@ function keyserver_watchdog {
echo 'fi' >> $keyserver_watchdog_script
chmod +x $keyserver_watchdog_script
# clear out log files daily
keyserver_watchdog_script=/etc/cron.daily/keyserver-db
echo '#!/bin/sh' > $keyserver_watchdog_script
echo 'if [ -d /var/lib/sks/DB ]; then' >> $keyserver_watchdog_script
echo ' cd /var/lib/sks/DB' >> $keyserver_watchdog_script
echo ' systemctl stop sks' >> $keyserver_watchdog_script
echo ' db_archive -d' >> $keyserver_watchdog_script
echo ' systemctl start sks' >> $keyserver_watchdog_script
echo 'fi' >> $keyserver_watchdog_script
chmod +x $keyserver_watchdog_script
}
......
......@@ -70,7 +70,9 @@ update-ca-certificates
# remove any keyserver log files
if [ -d /var/lib/sks/DB ]; then
cd /var/lib/sks/DB
systemctl stop sks
db_archive -d
systemctl start sks
fi
if [ ! -d $PROJECT_DIR ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment