为什么apache2和tomcat7服务无法在Ubuntu Cloudimg上自动启动?

时间:2013-11-08 03:47:51

标签: linux ubuntu virtualbox vagrant

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

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

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

一切都还可以,但apache2 ant tomcat7服务永远不会自动启动,我会尽力解决它,但我失败了。

以下是我试图做的事情:

cat /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服务是正常的。此服务可以自动启动。

怎么了?我怎么能解决这个问题?

0 个答案:

没有答案