OpenVZ Forum


Home » General » Support » "Unable to start init, probably incorrect template" in certain circumstances (several moun (VE can't start because of multiple -o bind mounts.)
"Unable to start init, probably incorrect template" in certain circumstances (several moun [message #38946] Tue, 23 February 2010 19:52 Go to next message
januszzz is currently offline  januszzz
Messages: 50
Registered: January 2007
Location: Opole, Poland
Member
Hi, I got real issue and please do not tell me this is feature, not bug Smile either, things are very wrong here Sad read on:

I got squashfs filesystem which is obviously mounted read-only. It icludes real openvz environment as well as single VE. The HE works perfectly, but Ve cannot start:

Warning: configuration file for distribution nx not found default used
Starting container ...
Container is mounted
Setting CPU units: 1000
Configure meminfo: 65536
Configure veth devices: veth102.0 veth102.1
Unable to start init, probably incorrect template
Container start failed
Stopping container ...
Container was stopped
Container is unmounted


I need to be able to write on some parts of squashfs, so I copy on boot /etc/ /var and some more directories. The rest of VE's directories are mounted with -o bind option, i.e.:

/mnt/livecd/vz/private/102/sbin on /vz/private/102/sbin type none (rw,bind)
/mnt/livecd/vz/private/102/sys on /vz/private/102/sys type none (rw,bind)
/mnt/livecd/vz/private/102/usr on /vz/private/102/usr type none (rw,bind)

etc.

You would say, that template is wrong, huh? its not, it is perfectly right as when I use rsync to copy the whole container to internal hdd, I can start the container without any problem:

rsync -avH /vz/private/102 /mnt/hdd
mount -o bind /mnt/hdd /vz/private/102

vzctl start 102
Warning: configuration file for distribution nx not found default used
Starting container ...
Container is mounted
Setting CPU units: 1000
Configure meminfo: 65536
Configure veth devices: veth102.0 veth102.1
Container start in progress...

What is happening then? a bug? a feature? maybe I shouldn't have mounted some dirs (proc,sys, I dunno what yet?)

I would be very thankful for any help!

[Updated on: Tue, 23 February 2010 19:54]

Report message to a moderator

Re: "Unable to start init, probably incorrect template" in certain circumstances (several [message #38948 is a reply to message #38946] Wed, 24 February 2010 01:36 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

Do you have /vz/root/102/sbin/init file? Is it executable?

Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: "Unable to start init, probably incorrect template" in certain circumstances (several [message #38957 is a reply to message #38948] Wed, 24 February 2010 10:07 Go to previous messageGo to next message
januszzz is currently offline  januszzz
Messages: 50
Registered: January 2007
Location: Opole, Poland
Member
Yes, init is in place, is executable. As I've said, when I blindly copy all the files the new container starts OK and I can always chroot into the container - both mounted with -o binds and the one copied (chroot /vz/private/102 /bin/bash, all here seems right)

In my opinion some bind mounts prevents entering the container.

But there is easy way to try the situation - just take a container and remount -o bind every single directory to another, like this:

cd /vz/private/102
mkdir 103
ls -1 | while read x; do mkdir /vz/private/103/$x; mount -o bind /vz/private/102/$x /vz/private/103/$x; done

then starting new container fails with the above command.

I do bind mounts previously to starting container, I do not use 102.mount script. The question I don't know the answer is if I could mount almost every single dir using the 102.mount script (all except etc,dev and var)? I haven't tried that yet.

[Updated on: Wed, 24 February 2010 10:16]

Report message to a moderator

Re: "Unable to start init, probably incorrect template" in certain circumstances (several [message #38958 is a reply to message #38957] Wed, 24 February 2010 14:25 Go to previous messageGo to next message
januszzz is currently offline  januszzz
Messages: 50
Registered: January 2007
Location: Opole, Poland
Member
Anyway - I got time pressure so I've did workaround: I do copy all dirs to tmpfs except the two biggest (usr and opt) which are not needed for VE boot. This made me loose about 100MB of ram, but I've decided I can live with this Smile

Then, I've used 102.mount script to mount /usr and /opt from squashfs.

The question about VE over bind mounts remains valid.
Re: "Unable to start init, probably incorrect template" in certain circumstances (several [message #49113 is a reply to message #38946] Mon, 25 March 2013 05:12 Go to previous messageGo to next message
gytang is currently offline  gytang
Messages: 3
Registered: March 2013
Junior Member
[root@localhost ~]# vzctl start 192
Starting container...
Container is mounted
Setting CPU units: 1000
Unable to start init, probably incorrect template
Container start failed
Killing container ...
Container was stopped
Container is unmounted
[root@localhost ~]#

???
Re: "Unable to start init, probably incorrect template" in certain circumstances (several [message #49114 is a reply to message #38946] Mon, 25 March 2013 05:14 Go to previous messageGo to next message
gytang is currently offline  gytang
Messages: 3
Registered: March 2013
Junior Member
[root@localhost ~]# vzctl start 192
Starting container...
Container is mounted
Setting CPU units: 1000
Unable to start init, probably incorrect template
Container start failed
Killing container ...
Container was stopped
Container is unmounted
[root@localhost ~]#

???
Re: "Unable to start init, probably incorrect template" in certain circumstances (several [message #49137 is a reply to message #38946] Fri, 29 March 2013 12:49 Go to previous message
Ales is currently offline  Ales
Messages: 330
Registered: May 2009
Senior Member
gytang, open a new thread and post all relevant information (kernel version, vzctl version, OS version, template you're using, etc.). Your problem is most likely very different than the januszzz's problem was.
Previous Topic: MySQL numfiles problem
Next Topic: How to build openvz from source
Goto Forum:
  


Current Time: Tue Feb 27 15:07:29 GMT 2024

Total time taken to generate the page: 0.03342 seconds