все.
Странные ошибки при попытке запустить cron на экземпляре Deb10. Root — единственный пользователь, которому удалось запустить cron. Я протестировал простой вызываемый регистратор и скрипт, который отправляет электронное письмо. Нет ошибок при запуске любого из скриптов вручную, но в системном журнале только 2 ошибки:
Oct 15 13:38:01 reports cron[8897]: Permission denied
Oct 15 13:38:01 reports CRON[9103]: Permission denied
Oct 15 13:38:01 reports cron[8897]: Permission denied
Oct 15 13:38:01 reports CRON[9102]: Permission denied
8897 — это pid основного процесса cron, запускаемого системой.
Этот хост был раскручен вместе с еще 3 или 4, у которых нет проблем с cron. Недавно этот был переименован, и IP-адрес изменился, но это единственное отличие от других. И /etc/hosts, и /etc/hostname отображают правильно, и хотя я не верю, что сертификаты ssl используются для cron, они настроены нормально. То же тестовое задание cron выполняется на других без проблем.
Разрешения на /var/spool/cron/crontabs
одинакова среди всех хостов, как и /var/log
.
Я не могу на всю жизнь увидеть, в каком разрешении отказано. Я проверил процесс cron, и все выглядело нормально.
Любые идеи о том, что может помешать пользователю cron и разрешить только root? Это самая большая подсказка, которая у меня есть до сих пор.
Образец данных
mcarter@reports:~$ crontab -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
*/1 * * * * /home/mcarter/test.sh >/dev/null 2>&1
mcarter@reports:~$ cat test.sh
#!/bin/bash
echo Testing | mailx mcarter@sjcourts.org -s "Cron test"
logger Cron test