这是 12.04 的新安装,我可以看到我的机器同时使用旧的 sysvinit 方法和新的 upstart 方法在启动时启动程序。
根据服务的手册页,如果存在,upstart 应该运行其服务,否则它将返回到 sysvinit。
现在在 /var/log/boot.log 中我有一堆错误,其中守护进程没有启动,例如 anacron:
initctl: Unknown job: S20anacron
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start S20anacron
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service S20dbus start
initctl: Unknown job: S20dbus
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start S20dbus
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service S20dmesg start
initctl: Unknown job: S20dmesg
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start S20dmesg
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service S20hostname start
initctl: Unknown job: S20hostname
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start S20hostname
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service S20hwclock start
* Stopping save kernel messages [ OK ]
initctl: Unknown job: S20hwclock
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start S20hwclock
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service S20hwclock-save start
* Starting LightDM Display Manager [ OK ]
initctl: Unknown job: S20hwclock-save
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start S20hwclock-save
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service S20network-interface start
initctl: Unknown job: S20network-interface
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start S20network-interface
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service S20network-interface-container start
* Stopping anac(h)ronistic cron [ OK ]
initctl: Unknown job: S20network-interface-container
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start S20network-interface-container
我可以看到我有 /etc/init/anacron.conf 和 /etc/init.d/anacron 以及
/etc/rc2.d/S20anacron
/etc/rc1.d/K20anacron
/etc/rc3.d/S20anacron
/etc/rc6.d/K20anacron
/etc/rc5.d/S20anacron
/etc/rc0.d/K20anacron
/etc/rc4.d/S20anacron
所以我在这里很困惑。 anacron 和 dbus 以及其余程序是否成功启动?我应该做些什么来解决这个“未知作业”问题吗?
从我的 /var/log/syslog 看来,我收到了来自 anacron 和 dbus 等的一些活动 - 但我不知道它是否已启用
我宁愿只看到记录的消息,就像其他内容一样:* 启动 ISC DHCP IPv4 服务器 [确定]
我还有一些守护进程需要安装 - 例如 iptables 和 dnsmasq - 因此在继续之前我想先理清这些问题。
谢谢
答案1
据我了解,这两种机制仍然存在,upstart 启动 rc 机制(参见/etc/init/rc.conf
),启动项应该使用任一机制,但不能同时使用两者。
在我的系统上,anacron 被定义为 中的原生 upstart 作业/etc/init/anacron.conf
,因此不应该有 S20anacron 或 K20anacron,因为xnn名称机制仅适用于 sysvinit。例如,我的系统上没有 S20anacron。与特定 upstart 作业相关的运行级别在运行级别适用的 upstart 作业配置文件中定义。
虽然服务命令可能首先查找 upstart 作业并优先运行这些作业而不是 /etc/init.d/ 作业,我知道 upstart 直接工作而不是使用 service 命令。
我不清楚为什么上述任何作业(dbus-daemon 除外)都应该继续运行。看来 anacron 在启动时由 upstart 运行,然后由 cron 定期运行(请参阅/etc/crontab
)。它的手册页说它是 cron 的补充,而不是 cron 的替代品。
由于我不知道您对系统所做的更改的详细信息,因此下面是我的 /etc/init/anacron.conf 的内容:
# anacron - anac(h)ronistic cron
#
# anacron executes commands at specific periods, but does not assume that
# the machine is running continuously
description "anac(h)ronistic cron"
start on runlevel [2345]
stop on runlevel [!2345]
expect fork
normal exit 0
exec anacron -s