From 5a37ac37dfe2eb13bed1cc7f644b5d46bfc5e90b Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 28 Aug 2020 08:58:41 +0200 Subject: [PATCH] Run maintenance task through a dedicated process (#105) --- rootfs/etc/cont-init.d/03-config.sh | 7 +++++++ .../{07-svc-weathermap.sh => 07-svc-cron.sh} | 14 +++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) rename rootfs/etc/cont-init.d/{07-svc-weathermap.sh => 07-svc-cron.sh} (66%) diff --git a/rootfs/etc/cont-init.d/03-config.sh b/rootfs/etc/cont-init.d/03-config.sh index 67d2d97..be9b960 100644 --- a/rootfs/etc/cont-init.d/03-config.sh +++ b/rootfs/etc/cont-init.d/03-config.sh @@ -179,6 +179,13 @@ if [ ! -z "${RRDCACHED_HOST}" ]; then EOL fi +# Config : Dispatcher +cat > ${LIBRENMS_PATH}/config.d/dispatcher.php <> ${CRONTAB_PATH}/librenms + +if [ "$LIBRENMS_WEATHERMAP" = "true" ] && [ -n "$LIBRENMS_WEATHERMAP_SCHEDULE" ]; then echo "Creating LibreNMS Weathermap cron task with the following period fields: $LIBRENMS_WEATHERMAP_SCHEDULE" echo "${LIBRENMS_WEATHERMAP_SCHEDULE} php -f /opt/librenms/html/plugins/Weathermap/map-poller.php" >> ${CRONTAB_PATH}/librenms fi @@ -28,10 +32,10 @@ echo "Fixing crontabs permissions..." chmod -R 0644 ${CRONTAB_PATH} # Create service -mkdir -p /etc/services.d/weathermap -cat > /etc/services.d/weathermap/run < /etc/services.d/cron/run <