OpenVZ Forum


Home » General » Support » *SOLVED* How to execute scripts on vzctl start veid
Re: How to execute scripts on vzctl start veid [message #15063 is a reply to message #15050] Wed, 18 July 2007 02:18 Go to previous messageGo to previous message
vaverin is currently offline  vaverin
Messages: 708
Registered: September 2005
Senior Member
Hi Gustavo.

ggonzalez wrote on Tue, 17 July 2007 20:17

The manual says these action scripts are located in /etc/sysconfig/vz-scripts.

On debian, are they to be located in /etc/vz/conf?


IMHO it is the same directory, /etc/vz/conf uses symlinks

ggonzalez wrote on Tue, 17 July 2007 20:17

Pardon my ignorance, but how is it that a mount script is executed before de VE starts? That is, how is it that these mounts are handled/available to the VE if the VE did not start yet?

What can be accomplished by a VE start script, that is executed before any VE init scripts? (what is the idea).



You cannot execute anything _before_ mount. To execute any scripts/binaries you need to read these files first, and to do it you need to mount according partition.

Let's look at hardware node: initrd mounts root partitions, procfs, sysfs, udev on the booting stage before any init scripts.

Mount-script for VE is something like initrd for Hardware node.
For VE we mounts its "/" by default, but when node admin wants to get access to external directories, it can do it by using mount-scripts.

ggonzalez wrote on Tue, 17 July 2007 20:17

If there is a need to call scripts AFTER the VE is fully initialized (from the HN), the only option now is the vznet.conf EXTERNAL_SCRIPT, right?


I'm not sure that understand you correctly: EXTERNAL_SCRIPT is executed to configure veth interface and on VE start it executed after <ve>.mount but before <ve>.start script.

However I do not think that using vznet.conf EXTERNAL_SCRIPT is good idea -- it executes not only on VE start but on _any_ veth re-configuration on live VE.

If you want to add something into VE from VE0 context -- please use <ve>.mount script. If you neet to execute something inside VE before initscripts -- please use <ve>.start script.

Is it not suitable for your purposes? In this case could you please explain, what do you means under "VE is fully initialized?". Is it when VE become accessible via network? Is it when last init-script inside VE has been finished?

If this event is after network initialization: you can write some client-server application: client inside VE will request any additional service and server in VE0 will handle these requests.

Thank you,
Vasily Averin
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: gateway - route
Next Topic: *SUCCESS* Centos 5 minimal template
Goto Forum:
  


Current Time: Wed Sep 11 04:32:55 GMT 2024

Total time taken to generate the page: 0.07377 seconds