]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
knot-resolver: Add initscript for the GC daemon
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 12 May 2026 15:35:59 +0000 (16:35 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 21 May 2026 15:27:28 +0000 (15:27 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/rootfiles/common/aarch64/initscripts
config/rootfiles/common/riscv64/initscripts
config/rootfiles/common/x86_64/initscripts
src/initscripts/system/kres-cache-gc [new file with mode: 0644]

index dc8c87681b2ca686af18f4a5e3e0860ed6c6afcd..080bcaa024434ba783472df9f76d584f754f7d99 100644 (file)
@@ -30,6 +30,7 @@ etc/rc.d/init.d/functions
 etc/rc.d/init.d/grub-btrfsd
 etc/rc.d/init.d/halt
 etc/rc.d/init.d/ipsec
+etc/rc.d/init.d/kres-cache-gc
 etc/rc.d/init.d/kresd
 etc/rc.d/init.d/leds
 etc/rc.d/init.d/lldpd
index c0a4bd5e9699c6f1195438c0c2c919c41ac0e175..9fdb165fcbe0dddf579a7d924c82f407ca14d453 100644 (file)
@@ -30,6 +30,7 @@ etc/rc.d/init.d/functions
 etc/rc.d/init.d/grub-btrfsd
 etc/rc.d/init.d/halt
 etc/rc.d/init.d/ipsec
+etc/rc.d/init.d/kres-cache-gc
 etc/rc.d/init.d/kresd
 etc/rc.d/init.d/leds
 etc/rc.d/init.d/lldpd
index c0a4bd5e9699c6f1195438c0c2c919c41ac0e175..9fdb165fcbe0dddf579a7d924c82f407ca14d453 100644 (file)
@@ -30,6 +30,7 @@ etc/rc.d/init.d/functions
 etc/rc.d/init.d/grub-btrfsd
 etc/rc.d/init.d/halt
 etc/rc.d/init.d/ipsec
+etc/rc.d/init.d/kres-cache-gc
 etc/rc.d/init.d/kresd
 etc/rc.d/init.d/leds
 etc/rc.d/init.d/lldpd
diff --git a/src/initscripts/system/kres-cache-gc b/src/initscripts/system/kres-cache-gc
new file mode 100644 (file)
index 0000000..12b7506
--- /dev/null
@@ -0,0 +1,52 @@
+#!/bin/sh
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007-2026  IPFire Team  <info@ipfire.org>                     #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+case "${1}" in
+       start)
+               boot_mesg "Starting Knot Resolver Garbage Collector..."
+               loadproc -b /usr/sbin/kres-cache-gc \
+                       -c /var/cache/knot-resolver \
+                       -d 60000
+               ;;
+
+       stop)
+               boot_mesg "Stopping Knot Resolver Garbage Collector..."
+               killproc /usr/sbin/kres-cache-gc
+               ;;
+
+       restart)
+               ${0} stop
+               sleep 1
+               ${0} start
+               ;;
+
+       status)
+               statusproc /usr/sbin/kres-cache-gc
+               ;;
+
+       *)
+               echo "Usage: ${0} {start|stop|restart|status}"
+               exit 1
+               ;;
+esac