aboutsummaryrefslogtreecommitdiff
path: root/buildtools/debian-skeleton/rpki-rp.prerm
diff options
context:
space:
mode:
Diffstat (limited to 'buildtools/debian-skeleton/rpki-rp.prerm')
-rw-r--r--buildtools/debian-skeleton/rpki-rp.prerm15
1 files changed, 12 insertions, 3 deletions
diff --git a/buildtools/debian-skeleton/rpki-rp.prerm b/buildtools/debian-skeleton/rpki-rp.prerm
index 37b111f2..b7e7cbde 100644
--- a/buildtools/debian-skeleton/rpki-rp.prerm
+++ b/buildtools/debian-skeleton/rpki-rp.prerm
@@ -20,16 +20,25 @@ set -e
case "$1" in
remove)
- crontab -l -u rcynic 2>/dev/null | awk '
+ # Record what will be needed to drop the databases completely,
+ # while we still have the necessary configuration data, but
+ # postpone dropping the databases until the postrm script,
+ # since that's where we find out whether this is a purge.
+
+ rpki-sql-setup --debug --verbose --postgresql-root-username postgres script-drop /etc/rpki/drop_databases.sql
+
+ # Clean up our cron job.
+
+ crontab -l -u rpki 2>/dev/null | awk '
$0 !~ "exec /usr/bin/rcynic-cron" {
line[++n] = $0;
}
END {
if (n)
for (i = 1; i <= n; i++)
- print line[i] | "crontab -u rcynic -";
+ print line[i] | "crontab -u rpki -";
else
- system("crontab -u rcynic -r");
+ system("crontab -u rpki -r");
}'
;;