我使用官方的ubuntu cloudimg作为测试环境,并在以下页面下载:
http://cloud-images.ubuntu.com/vagrant/raring/current/
我使用vagrant+virtualbox来部署box文件。
一切都很好,但Apache2和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服务是正常的。此服务可以自动启动。
怎么了?我怎样才能解决这个问题?
最佳答案
我也遇到过类似的问题。我想是这个虫子引起的:
sysv init scripts not started on boot with cloud ubuntu raring
虽然这个bug还没有被确认,但是bug报告中描述的解决方法(使用/etc/init/rc.conf中的“控制台日志”)对我有效。