我在MediaTemple(ve)服务器上运行Ubuntu 9.10和10.04。
在他们两人之间, anacron设置被打破,…自从我第一次安装Ubuntu以来,它们已经被破坏了。 最近才发现我的日志文件没有旋转。
我希望有一个工作的人可以帮助诊断问题并提出修复build议。
这里是/etc/cron.d/anacron …这部分工作正常:每天早上7:30, cron执行这个命令启动anacron。
# /etc/cron.d/anacron: crontab entries for the anacron package SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 30 7 * * * root test -x /etc/init.d/anacron && /etc/init.d/anacron start >/dev/null
问题是/etc/init.d/anacron start失败:
# /etc/init.d/anacron start >/dev/null start: Unknown job: anacron
请注意,/etc/init.d/anacron是到/ lib / init / upstart-job的符号链接:
# ls -l /etc/init.d/anacron lrwxrwxrwx 1 root root 21 Jan 12 2010 /etc/init.d/anacron -> /lib/init/upstart-job
现在我很难过 任何人有任何build议如何解决这个问题?
看看/ var / log ,看看你的日志文件是否正在旋转(而不是无限增长)。 如果他们正在旋转,那么你可能有一个工作anacron ,所以请检查您的设置,让我知道它是如何不同于我的。
提前致谢, …
Upstart实际上使用/etc/initconfiguration文件来保存每个服务,而不是/etc/init.d 。 我假设/etc/init.d链接是为了保持与sysvinit的兼容性。 这里是新手入门指南 ,这解释了这一点。
我没有Ubuntu系统,所以我不能检查/etc/init/anacron.conf的内容,但我怀疑从gooling它可能只是exec anacron -s 。 检查/etc/init.removed/ ,看看是否有一个anacron.conf在那里被某些升级过程删除。 你也许可以重新安装anacron来解决这个问题。
Ubuntu 10.04 /etc/cron.d/anacron:
# /etc/cron.d/anacron: crontab entries for the anacron package SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin #30 7 * * * root test -x /etc/init.d/anacron && /usr/sbin/invoke-rc.d anacron start >/dev/null 30 7 * * * root start -q anacron || :
/etc/init.d/anacron start:
# /etc/init.d/anacron start Rather than invoking init scripts through /etc/init.d, use the service(8) utility, eg service anacron start Since the script you are attempting to invoke has been converted to an Upstart job, you may also use the start(8) utility, eg start anacron # ls -al /etc/init.d/anacron lrwxrwxrwx 1 root root 21 2011-01-10 19:05 /etc/init.d/anacron -> /lib/init/upstart-job anacron start/running, process 5446
当/ usr / sbin / anacron不存在时,/etc/cron.daily/logrotate可以在没有anacron的情况下启动(/ etc / crontab):
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 )