cron run-parts 以 exitcode 1 退出,而独立脚本运行正常

cron run-parts 以 exitcode 1 退出,而独立脚本运行正常

安装后msktutil,cron 每天都会抱怨,并且我会收到包含以下内容的电子邮件:

run-parts: /etc/cron.daily/msktutil exited with return code 1

当我跑步时:

user@box:~$ sudo /etc/cron.daily/msktutil
user@box:~$ echo $?
0

另外,如果我修改 msktutil 以在详细模式下运行,则不会暴露任何内容(它告诉我更改 keytab 内容还为时过早)。

我错过了哪些重要的测试来查明(真正痛苦的)问题?

/etc/crontab 文件是:

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user  command
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#

msktutil 是一个 sh 脚本:

cat /etc/cron.daily/msktutil
#!/bin/sh

test -x /usr/sbin/msktutil || exit 0

# These options are overridden in /etc/default/msktutil.
# Edit there, not here.
AUTOUPDATE_ENABLED="false"
AUTOUPDATE_OPTIONS=""

[ -r /etc/default/msktutil ] && . /etc/default/msktutil

[ "$AUTOUPDATE_ENABLED" = "true" ] || exit 0
exec /usr/sbin/msktutil --auto-update $AUTOUPDATE_OPTIONS

相关内容