1

我使用官方的 Ubuntu Cloudimg 作为我的测试环境,我在这个页面下载它:

http://cloud-images.ubuntu.com/vagrant/raring/current/

我使用 vagrant + virtualbox 来部署 box 文件。

一切都很好,但 apache2 ant tomcat7 服务从不自动启动,我尝试尽一切努力解决它,但我失败了。

这是我尝试做的事情:

猫 /var/log/boot.log

Cloud-init v. 0.7.2 running 'init-local' at Thu, 05 Sep 2013 01:15:26 +0000. Up 3.59 seconds.
cloud-init-nonet[3.70]: waiting 10 seconds for network device
rpcbind: Cannot open '/run/rpcbind/rpcbind.xdr' file for reading, errno 2 (No such file or directory)^M
rpcbind: Cannot open '/run/rpcbind/portmap.xdr' file for reading, errno 2 (No such file or directory)^M
cloud-init-nonet[4.74]: static networking is now up
Cloud-init v. 0.7.2 running 'init' at Thu, 05 Sep 2013 01:15:28 +0000. Up 4.89 seconds.
ci-info: +++++++++++++++++++++++++Net device info+++++++++++++++++++++++++
ci-info: +--------+------+-----------+---------------+-------------------+
ci-info: | Device |  Up  |  Address  |      Mask     |     Hw-Address    |
ci-info: +--------+------+-----------+---------------+-------------------+
ci-info: |   lo   | True | 127.0.0.1 |   255.0.0.0   |         .         |
ci-info: |  eth0  | True | 10.0.2.15 | 255.255.255.0 | 08:00:27:ae:1a:5c |
ci-info: +--------+------+-----------+---------------+-------------------+
ci-info: ++++++++++++++++++++++++++++++Route info++++++++++++++++++++++++++++++
ci-info: +-------+-------------+----------+---------------+-----------+-------+
ci-info: | Route | Destination | Gateway  |    Genmask    | Interface | Flags |
ci-info: +-------+-------------+----------+---------------+-----------+-------+
ci-info: |   0   |   0.0.0.0   | 10.0.2.2 |    0.0.0.0    |    eth0   |   UG  |
ci-info: |   1   |   10.0.2.0  | 0.0.0.0  | 255.255.255.0 |    eth0   |   U   |
ci-info: +-------+-------------+----------+---------------+-----------+-------+
2013-09-05 09:15:28,570 - cloud-init[WARNING]: Stdout, stderr changing to (| tee -a /var/log/cloud-init-output.log, | tee -a /var/log/cloud-init-output.log)

奇怪的是,只有第一次启动日志。之后永远不要在 boot.log 中写入任何日志。

ll /etc/rc2.d/

total 12
drwxr-xr-x   2 root root 4096 Sep  3 10:31 ./
drwxr-xr-x 116 root root 4096 Nov  8 11:26 ../
-rw-r--r--   1 root root  677 Jan 30  2013 README
lrwxrwxrwx   1 root root   17 Sep  2 17:09 S20postfix -> ../init.d/postfix*
lrwxrwxrwx   1 root root   22 Sep  2 17:09 S20redis-server -> ../init.d/redis-server*
lrwxrwxrwx   1 root root   32 Aug 31 12:06 S20virtualbox-guest-utils -> ../init.d/virtualbox-guest-utils*
lrwxrwxrwx   1 root root   16 Aug 31 12:06 S21puppet -> ../init.d/puppet*
lrwxrwxrwx   1 root root   13 Sep  3 10:31 S23ntp -> ../init.d/ntp*
lrwxrwxrwx   1 root root   26 Aug 31 11:36 S45landscape-client -> ../init.d/landscape-client*
lrwxrwxrwx   1 root root   15 Aug 31 11:36 S50rsync -> ../init.d/rsync*
lrwxrwxrwx   1 root root   19 Aug 31 11:36 S70dns-clean -> ../init.d/dns-clean*
lrwxrwxrwx   1 root root   18 Aug 31 11:36 S70pppd-dns -> ../init.d/pppd-dns*
lrwxrwxrwx   1 root root   14 Aug 31 11:34 S75sudo -> ../init.d/sudo*
lrwxrwxrwx   1 root root   17 Sep  2 17:08 S91apache2 -> ../init.d/apache2*
lrwxrwxrwx   1 root root   17 Sep  2 17:07 S92tomcat7 -> ../init.d/tomcat7*
lrwxrwxrwx   1 root root   21 Aug 31 12:06 S99chef-client -> ../init.d/chef-client*
lrwxrwxrwx   1 root root   21 Aug 31 11:36 S99grub-common -> ../init.d/grub-common*
lrwxrwxrwx   1 root root   18 Aug 31 11:34 S99ondemand -> ../init.d/ondemand*
lrwxrwxrwx   1 root root   18 Aug 31 11:34 S99rc.local -> ../init.d/rc.local*

您可以看到 apache2 和 tomcat7 服务以S.

但是我必须service apache2 start ; service tomcat7 start在每次启动后使用命令手动启动服务。

但是mysql服务正常。该服务可以自动启动。

怎么了?我该如何解决这个问题?

4

1 回答 1

3

我一直有类似的问题。我认为这是由这个错误引起的: sysv init scripts not started on boot with cloud ubuntu raring

尽管该错误尚未得到确认,但错误报告中描述的解决方法(使用 /etc/init/rc.conf 中的“控制台日志”)对我有用。

于 2013-11-12T08:15:55.213 回答