diff --git a/src/freedombone-app-keyserver b/src/freedombone-app-keyserver index 189f36ba..80cb9fa1 100755 --- a/src/freedombone-app-keyserver +++ b/src/freedombone-app-keyserver @@ -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 } diff --git a/src/freedombone-upgrade b/src/freedombone-upgrade index cc1e7da3..1cee7878 100755 --- a/src/freedombone-upgrade +++ b/src/freedombone-upgrade @@ -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