#1094661 munin: Implicit cron dependency not specified

#1094661#5
Date:
2025-01-29 20:44:34 UTC
From:
To:
Dear Maintainer,

If munin is installed in a minimal Debian bookworm container (e.g. with
"mmdebstrap --variant=minbase") that does not have a cron installed,
then it never runs.

Before systemd I would have perhaps asked that cron be added as an
explicit dependency. However, given that systemd is now a default
package then I guess systemd timers and services would be more
appropriate to include and enable (and start?).

As a starting point, the following config files have at least begun
populating /var/lib/munin with rrd files for me.

    mark@mon:/etc/systemd/system$ cat munin-update.timer
        [Unit]
        Description=Munin Update

        [Timer]
        OnCalendar=*-*-* *:0/5
        Persistent=true

        [Install]
        WantedBy=timers.target

    mark@mon:/etc/systemd/system$ cat munin-update.service
        [Unit]
        Description=Munin Update

        [Service]
        User=munin
        ExecStart=/usr/bin/munin-cron

Regards,
Mark

#1094661#10
Date:
2025-04-12 14:26:44 UTC
From:
To:
control: severity -1 important
thanks

Hi Mark,

thanks for filling this bug report (and sorry for not having responded so
long)!

agreed.
[...]
[...]

nice. did you notice any other problems / missing features without cron
installed?

I'm also wondering how to both ship the crontab entries for systems not
running systemd while at the same preventing dual runs via systemd timer
and cron. I'd appreciate pointers or insight on this!

OTOH I've tagged "#1003862 munin-node fails to start on traditional sysvinit
system" as wontfix, so maybe I should not bother about the non-systemd case
and just drop those crontab files (or ship them as examples..)

#1094661#17
Date:
2025-04-12 15:10:57 UTC
From:
To:
ISTM the canonical way is exiting the cron job, like this:

% head -n 13 /etc/cron.daily/apt-compat
#!/bin/sh

set -e

# Systemd systems use a systemd timer unit which is preferable to
# run. We want to randomize the apt update and unattended-upgrade
# runs as much as possible to avoid hitting the mirrors all at the
# same time. The systemd time is better at this than the fixed
# cron.daily time
if [ -d /run/systemd/system ]; then
    exit 0
fi


Chris

#1094661#22
Date:
2025-04-12 15:17:14 UTC
From:
To:
ah! thank you, very much appreciated!
#1094661#27
Date:
2025-04-12 15:25:58 UTC
From:
To:
Or the same in the cron.d/snippet, c.f.

% grep systemd /etc/cron.d/*
/etc/cron.d/e2scrub_all:30 3 * * 0 root test -e /run/systemd/system || SERVICE_MODE=1 /usr/libexec/e2fsprogs/e2scrub_all_cron
/etc/cron.d/e2scrub_all:10 3 * * * root test -e /run/systemd/system || SERVICE_MODE=1 /sbin/e2scrub_all -A -r
/etc/cron.d/php:09,39 *     * * *     root   [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi


Cheers,
gregor