startup order

mwixon

New Member
Apr 28, 2009
27
0
1
Can anyone point me to some docs on how openvz boots a container? I'm having trouble with the centos container where everything is rc3.d is started before runlevel 3 is entered and before networking is up.

While most services can ride through this, this causes tomcat to fail to startup.


Thanks
-Mike
 
Here is some more info. I did a simple test. I'm running the standard centos-4-7 template from the proxmox website. After installing I simply did:

yum install mysql-server

then I did a reboot of the container.

here is /var/log/messages:

Code:
May  8 07:27:26 test2 httpd: httpd shutdown succeeded
May  8 07:27:26 test2 sshd: sshd shutdown succeeded
May  8 07:27:26 test2 sendmail: sm-client shutdown succeeded
May  8 07:27:26 test2 sendmail: sendmail shutdown succeeded
May  8 07:27:28 test2 mysqld: Stopping MySQL:  succeeded
May  8 07:27:28 test2 xinetd[392]: Exiting...
May  8 07:27:28 test2 xinetd: xinetd shutdown succeeded
May  8 07:27:28 test2 crond: crond shutdown succeeded
May  8 07:27:28 test2 exiting on signal 15
May  8 07:48:07 test2 syslogd 1.4.1: restart.
May  8 07:48:07 test2 syslog: syslogd startup succeeded
May  8 07:48:07 test2 syslog: klogd succeeded
May  8 07:48:07 test2 sshd:  succeeded
May  8 07:48:07 test2 xinetd: xinetd startup succeeded
May  8 07:48:07 test2 xinetd[385]: xinetd Version 2.3.13 started with libwrap loadavg options compiled in.
May  8 07:48:07 test2 xinetd[385]: Started working: 0 available services
May  8 07:48:09 test2 mysqld: Starting MySQL:  succeeded
May  8 07:48:09 test2 sendmail: sendmail startup succeeded
May  8 07:48:09 test2 sendmail: sm-client startup succeeded
May  8 07:48:09 test2 httpd: httpd startup succeeded
May  8 07:48:09 test2 crond: crond startup succeeded
May  8 07:48:09 test2 init: no more processes left in this runlevel
May  8 07:48:06 test2 date: Fri May  8 07:48:06 MSD 2009 
May  8 07:48:06 test2 rc.sysinit: Setting clock : Fri May  8 07:48:06 MSD 2009 succeeded 
May  8 07:48:07 test2 rc.sysinit: -e 
May  8 07:48:07 test2 sysctl: net.ipv4.ip_forward = 0 
May  8 07:48:07 test2 rc.sysinit: Configuring kernel parameters:  succeeded 
May  8 07:48:07 test2 rc.sysinit: Setting hostname test2:  succeeded 
May  8 07:48:07 test2 mount: mount: permission denied 
May  8 07:48:07 test2 rc.sysinit: Remounting root filesystem in read-write mode:  failed 
May  8 07:48:07 test2 rc.sysinit: Mounting local filesystems:  succeeded 
May  8 07:48:07 test2 rc.sysinit: Enabling local filesystem quotas:  succeeded 
May  8 07:48:07 test2 rc.sysinit: Enabling swap space:  succeeded 
May  8 07:48:07 test2 init: Entering runlevel: 3 
May  8 07:48:07 test2 iptables:  succeeded 
May  8 07:48:07 test2 last message repeated 2 times
May  8 07:48:07 test2 sysctl: net.ipv4.ip_forward = 0 
May  8 07:48:07 test2 network: Setting network parameters:  succeeded 
May  8 07:48:07 test2 network: Bringing up loopback interface:  succeeded 
May  8 07:48:07 test2 ifup: SIOCADDRT: No such process 
May  8 07:48:07 test2 network: Bringing up interface venet0:  succeeded 
May  8 07:48:26 test2 sshd(pam_unix)[542]: session opened for user root by (uid=0)
Note how sendmail, mysql, etc startup before network? What controls this?

Thanks
-Mike
 
This is not OpenVZ specific. OpenVZ simply starts '/sbin/init'. This is usually the standard sysv init (see 'man init').

- Dietmar
 
Actually if you look closer at the log file it looks like the system time is getting set in the middle of the startup. It's actually starting in the right order: init -> rc.sysinit, run level 3 but they messages in the log are coming at different times.

Back to the drawing board to figure out why tomcat won't start on boot ....

Thanks for the reply though.
-Mike
 
Hi,

I got exactly the same problem.
I moved my containers from proxmox 0.9 to 1.3
The startup of the tomcat container ran fine until this migration and I get the same problem as mwixon : venet is started after tomcat causing it to fail.
Of course, when I move the container back to a server with proxmox 0.9, no problem.

I added ifup test in tomcat startup script to get confirmation that network was not up during tomcat startup.

The container is a debian etch with standard tomcat setup.

I used a workaround to fix the problem:

sudo update-rc.d -f tomcat remove
sudo update-rc.d tomcat stop 19 0 1 6 .

and in /etc/network/if-up.d/tomcat the following script

#!/bin/sh -e
if [ "$IFACE" = "lo" ]; then
exit 0
fi
/etc/init.d/tomcat start

I hope the problem can be solvedmore elegantly
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!