Univention Bugzilla – Bug 56378
cron error mail every 5m by univention-monitoring-client/scripts/check_univention_replication when unjoined
Last modified: 2023-08-18 12:51:15 CEST
/etc/cron.d/univention-monitoring-client runs run-parts /usr/share/univention-monitoring-client/scripts/ every 5 minutes, which calls /usr/share/univention-monitoring-client/scripts/check_univention_replication which calls get_notifier_id.py printing usage: get_notifier_id.py [-h] [-m MASTER] [-s] get_notifier_id.py: error: ldap/master or --master not set when the system is not joined yet. root@korpon:~# grep -c get_notifier_id.py /var/mail/systemmail 106654
root@flytta:~# grep -c get_notifier_id.py /var/mail/systemmail 106472
What now? 1. Set "monitoring/client/cron" in the joinscript instead of as default value. Then reload crond.service in the joinscript. 2. fix the specific script to handle this situation?
(In reply to Florian Best from comment #2) > What now? Scripts should not run / fail silently if their pre-condition is not met, e.g. [ -f /var/univention-join/joined ] || exit 0 At least > result = subprocess.check_output(['/usr/share/univention-directory-listener/get_notifier_id.py']) should use > …, stderr=subprocess.DEVNULL to silence its error output which otherwise CRON will collect and mail.